Is there any way to customize a group (sub set) of rows in the grid component. ie. change the cell background color. by means of populating it from a .json file?
Thanks,
Pipe
Is there any way to customize a group (sub set) of rows in the grid component. ie. change the cell background color. by means of populating it from a .json file?
Thanks,
Pipe
Hello,
grid doesn’t provide “row css” functionality. We will add it in the next version.
Currently, you may redefine type.template_start of the grid as follows:
dhx.ui({
...
{
view:"grid",
....
type:{
template_start:function(obj,type){
return "<table dhx_f_id='"+obj.id+"' class='"+type.template_css(obj,type)+" dhx_grid_row"+(obj.$selected?"_selected":"")+"' cellpadding='0' cellspacing='0' "+(type.total_width?"style='width:"+type.total_width+"px'":"")+"><tr>";
},
template_css:function(obj,type){
return (obj.rowcss?obj.rowcss:"");
}
},
datatype:"json",
data:gridData
}
});
Where rowcss is the item property that contains css class name:
gridData = [
{id:1,rowcss:“custom”,…},
…
]