RealGrid2 Guide
Style & Theme
Cell dynamic style

Cell dynamic style

Cell dynamic styles are used when you want to apply styles to individual cells.

If the cell value is "Female", "Canada", or "VND", it is displayed in orange and cannot be edited.

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

   gridView.setCellStyleCallback(function(grid, dataCell) {
     var ret = {}
    
     if ((dataCell.value == 'Female') || (dataCell.value == 'Canada') || (dataCell.value == 'VND')){
       ret.styleName = 'orange-color'; // ret.style = {background:"#ffff00"} Style can be applied directly
       ret.editable = false;
     }
 
     return ret;
   })