Author Topic: addClass not working  (Read 2338 times)

omerix

  • Pro Enterprise
  • Full Member
  • *
  • Posts: 147
    • View Profile
addClass not working
« on: December 07, 2018, 02:46:39 pm »
Hello,

I want to paint row with addClass when I do "rowClick" but it doesn't work.

The codes I tried;

1) $('Pq1117Recete').pqGrid('addClass', {rowIndx: ui.rowIndx,cls: 'pq-striped-error'});
Not working, No Error

2) this.pqGrid('addClass', {rowIndx: ui.rowIndx,cls: 'pq-striped-error'});
Not working. 
Error:Uncaught TypeError: this.pqGrid is not a function

3) grid.pqGrid('addClass', {rowIndx: ui.rowIndx,cls: 'pq-striped-error'});
Error: Uncaught TypeError: grid.pqGrid is not a function

pqgrid.css
Code: [Select]
.pq-striped-error {
background-color:rgba(245, 132, 132, 1.0)  !important;
color:#ffffff !important;
}

.pq-striped-ok {
background-color:rgba(169, 208, 142, 1.0)  !important;
border-color:rgba(169, 208, 142, 1.0)  !important;
color:#000000 !important;
}


http://jsfiddle.net/omerx/0wgs1orb/141/



paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6158
    • View Profile
Re: addClass not working
« Reply #1 on: December 07, 2018, 03:12:26 pm »
pqGrid is jQuery method. addClass is a method of pqgrid instance.

Code: [Select]
rowClick: function(evt, ui){
     this.addClass({rowIndx: ui.rowIndx,cls: 'pq-striped-error'});
}

http://jsfiddle.net/vw3t2zba/

omerix

  • Pro Enterprise
  • Full Member
  • *
  • Posts: 147
    • View Profile
Re: addClass not working
« Reply #2 on: December 08, 2018, 01:49:44 pm »
Thanks. Worked.

pqGrid is jQuery method. addClass is a method of pqgrid instance.

Code: [Select]
rowClick: function(evt, ui){
     this.addClass({rowIndx: ui.rowIndx,cls: 'pq-striped-error'});
}

http://jsfiddle.net/vw3t2zba/