- Set the row style/css (all rows)
Use the RowAttr property :
- For style
delphi codeFGrid.JQGridOptions.RowAttr:= '{ "style" : "color: orange;" }
- For css class
delphi codeFGrid.JQGridOptions.RowAttr:= '{ "class" : "mycss-class" }
- For style
- Set the row style/css based on cell value
Use the RowAttrFn property:
delphi codeJScript:= TIWCGJScript.Create;
try
with JScript do
begin
Add('function(ts, td, curr, id){');
Add(' if (ts.Kind == "0") {');
Add(' return { "style" : "color: red"}');
Add(' } else {');
Add(' return { "style" : "color: green"}');
Add(' }');
Add('}')
end;
Result.JQGridOptions.RowAttrFn.Script:= JScript.Text;
finally
JScript.Free;
end;
In the example above, we will check the value of the column "Kind", and based on the value change the text color.
Check documentation for more information.
Best Regards.