Author Topic: Cell Highlighting - pq_cellcls  (Read 5010 times)

jprocess

  • Newbie
  • *
  • Posts: 4
    • View Profile
Cell Highlighting - pq_cellcls
« on: February 19, 2014, 02:54:11 am »
Hi -

I am using this to get a specific cell:

var cell = $grid.pqGrid( "getCell", {rowIndx: 4, colIndx:3} );

and

$(cell).addClass('yellow');

to highlight t cell. It will work, but when I scroll the grid the style disappears.

Can I use pq_cellcls to highlight specific cells like I"m doing with pq_rowcls?

 $grid.pqGrid( dir, {pq_rowcls: "orange"} );

I'm currently using it to highlight rows but cannot figure out how to do it with cells. i.e. pq_cellcls

Thanks much

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Cell Highlighting - pq_cellcls
« Reply #1 on: February 19, 2014, 06:21:50 pm »
Quote
Can I use pq_cellcls to highlight specific cells like I"m doing with pq_rowcls?

 $grid.pqGrid( dir, {pq_rowcls: "orange"} );

What's dir in your code.

pq_rowcls and pq_cellcls are meant to add classes to rows and cells directly in JSON data. It's useful when you are loading data from remote server.

e.g if your rowData is { name 'henry' , age: 30 }

and you want to add yellow class to age field in this row.

your row data would look like { name: 'henry', age: 30, pq_cellcls : { age: 'yellow'} }

or

Alternatively you can use API to add class

$grid..pqGrid( "addClass", {rowIndx: 2, dataIndx: 'age', cls: 'pq-yellow'} );




jprocess

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Cell Highlighting - pq_cellcls
« Reply #2 on: February 19, 2014, 06:53:33 pm »
dir is my var for getRowData.

I used the API to add the class. That worked.

Thanks again!