RealGrid2 Guide
Style & Theme
Row dynamic style

row dynamic style

Row dynamic styles are used when you want to apply a style to the entire row based on a specific value.

If the value of the star is “female”, it is displayed in orange.

※ Within setRowStyleCallback, you must not perform operations that take a long time or change the value, such as setValue().

   gridView.setRowStyleCallback(function(grid, item, fixed) {
     var ret = {};
     var gender = grid.getValue(item.index, "Gender");
 
     if (gender == 'female') {
       return 'orange-color'
     }
   })

Setting whether to dynamically edit rows

Dynamically sets editability based on the value of a specific column on a row-by-row basis.

Rows with a value of "Female" in the Gender column cannot be modified.

gridView.setRowStyleCallback(function(grid, item, fixed) {
     var ret = {};
     var gender = grid.getValue(item.index, "Gender");
 
     if (gender == 'female') {
       ret.editable = false
       ret.styleName = 'orange-color' // ret.style = {background:"#ffff00"} Style can be applied directly
     }
 
     return ret;
   })