RealGrid2 API
Interface
RowStyleObject

RowStyleObject

Style model returned when changing the style of a row with RowStyleCallback

Signature:

export interface RowStyleObject

Remarks

Used in GridBase.setRowStyleCallback().

Example

cosnt f = function(grid, item fixed) {
   if (dataProvider.getValue(item.dataRow, "fieldName") === "value") {
     return {
       editable: false,
       styleName: "userStyleName"
     }
   }
}
gridView.setRowStyleCallback(f);

Properties

PropertyTypeDescription
editablebooleanWhether or not the entire row is editable
exportStyleNamestringStyle name applied when exporting to Excel
readOnlybooleanReadOnly status of entire row
stylePartial<CSSStyleDeclaration>inline style applied to the tr element in the line
styleNamestringclassName of row

Properties Desc

editable

Whether the entire row is editable

Type - boolean

Remarks:

If not specified, the next rank editable is applied.


exportStyleName

Style name applied when exporting to Excel

Type - string


readOnly

ReadOnly status of entire row

Type - boolean

Remarks:

If not specified, the next rank editable is applied.


style

inline style applied to the tr element in the row

Type - Partial<CSSStyleDeclaration>

Remarks:

Specifies properties that are directly applied to the style of tr.

Example:

const f = function(grid, item, fixed) {
  var ret = { style: {background:undefined, color: undefined}}
  if (dataProvider.getValue(item.dataRow, "fieldName") === "A") {
      ret.style.background = "red";
    } else if (dataProvider.getValue(item.dataRow, "fieldName") === "B") {
      ret.style.color = "red";
    } else if (dataProvider.getValue(item.dataRow, "fieldName") === "C") {
      ret.style.background = "lightblue"
      ret.style.color = "red";
    }
  };
  return ret;
}

styleName

className of the row

Type - string

Remarks:

If not specified, the grid's default style name is used.