Hi,
I need to change the style of the entire row based in a cell value.
I’m trying to use the cellclassname as follows, but I don’t know how to check the cell value (status), because the id of the grid is created dinamicaly and I don’t know how to select it. Is there a better way to do it?
`var cellclass_captacao = function (row, columnfield, value, defaulthtml, columnproperties) {
var status = $(?????).jqxGrid(‘getCell’, row, ‘status’);
if(status.value == ‘2’){
return ‘captacao_row’;
}
}
columns = [
{
text : ‘status’,
datafield : ‘status’,
hidden:true
},
{
text : ‘Bairro’,
datafield : ‘bairro’,
cellsalign : ‘left’,
cellclassname: cellclass_captacao
},
{
text : ‘Dormitórios’,
datafield : ‘n_dormitorios’,
cellsalign : ‘center’,
cellclassname: cellclass_captacao
}
];
var source = {
datatype : ‘json’,
type: ‘POST’,
data: {action:action},
datafields : datafields,
url : ‘php/lists.php’,
};
var dataAdapter = new $.jqx.dataAdapter(source);
$(“#”+tab+”-int”).jqxGrid({
width: ‘100%’,
height: ‘94%’,
source: dataAdapter,
columns: columns
});`
thanks in advance for any advice!