ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: omerix on December 07, 2018, 02:46:39 pm

Title: addClass not working
Post by: omerix 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/


Title: Re: addClass not working
Post by: paramvir 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/
Title: Re: addClass not working
Post by: omerix 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/