v7.3.0

GridRowModel

Model extended with some fields related to grid rendering. Used as default model type in the grids store if nothing else is specified.

Using this model is optional. If you use a custom model instead and need the functionality of any of the fields below, you just have to remember to add fields with the same name to your model.

// GridRowModel is used automatically, or extend it for custom fields:
class MyModel extends GridRowModel {
    static fields = [
        { name : 'name', type : 'string' },
        { name : 'age', type : 'number' }
    ];
}

const grid = new Grid({ store : { modelClass : MyModel, data : [...] }, columns : [ { field : 'name', text : 'Name' }, { field : 'age', text : 'Age' } ] });

Useful fields

Field Description
iconCls Icon CSS class for tree rows
cls CSS class(es) to add to the row element
rowHeight Custom row height for this record
href Link URL for tree column rendering

See also

  • Model - Base model class
  • store - Assigning a store to the grid
No results

Fields

Fields belong to a Model class and define the Model data structure
  • A boolean field used by the LockRows feature for pinning a row to the top.

  • CSS class (or several classes divided by space) to append to row elements

  • Icon for row (used automatically in tree, feel free to use it in renderer in other cases)

  • Used by the default implementation of getRowHeight to determine row height. Set it to use another height than the default for the records row.

  • A link to use for this record when rendered into a TreeColumn.

  • target : '_self'/'_blank'/'_parent'/'_top'/null

    The target to use if this tree node provides a value for the href field.

Properties

Properties are getters/setters or publicly accessible variables on this class

Source path

Grid/data/GridRowModel.js

Contents