SMART datagrid v.1 > Classes > DataSet
DataLudi.DataSet.setRowTag method
Specify user data which can be managed in application in each data row.
The data of any types, such as JSON object or a simple value, is possible. After changing Tag, GridDataSet.onTagChanged event or TreeDataSet.onTagChanged event will be fired. In addition, you can refer the specified tag in data set or several Expressions of grid and tree.
You can get the tag which is set in data row by getRowTag.
function setRowTag (row: Integer|TreeDataRow, tag: *);
- Returns
- Void
- Parameters
- row - Integer|TreeDataRow. required.
- tag - *. required.
The application data.
- Note
- In the case of specifying object as tag, it will not copy and save in DataSet. In other words, if change the properties of object after specifying as tag, the state will be maintained. If not a special case, it should be manged as a read-only object.
Code -1
var row = grid.focusedRow();
if (row) {
var tag = _getRowTag(row);
ds.setRowTag(row.dataIndex(), tag);
}
- See Also
- GridDataSet.onTagChanged
- TreeDataSet.onTagChanged
- getRowTag
- setRowTags
- TreeDataRow
- Expression
- DerivedField.expression
- Examples
- Derived Field & Row Tags
- Tree Data Tag
- Column Dynamic Styles
- Row Dynamic Styles