With javascript function cellattr is possible to set attributes for a particular cell, which correspond to certain column in the grid.
Example: the cell is defined as following HTML in the grid :

... <td> My Content </td>

If the function return the string style='color:red' class='myclass', then the contents in the dom for that column will be

... <td style='color:red' class='myclass'> My Content </td>

As can be seen we can set any valid attribute for the cell including colspan and rowspan

In PHP this will look like this:

<?php ... $mycellattr = <<< CELLATTR function (rowid, value, rawObject, colModel, arraydata) { return "style='color:red' class='myclass' "; } CELLATTR; $grid ->setColProperty('field', array("cellattr"=>"js:".$mycellattr)); ... ?>


Parameters passed to this function are

  • rowId - the id of the row
  • value - the values of the cell after it is formated (if a formatter is used)
  • rawObject - the row data from the server response - either array or xml node
  • colModel - all colmodel optins for that field
  • arraydata - a pair name:value of the data which is already inserted in this row.