SMART datagrid v.1 > Classes > CalculatedColumn
Expression which returns the value of calculated column cell.
If specify valueCallback, this value will be ignored.
You can use field names as variable in expression. And, besides field names, you can also use the variables listed in the table below in expression.
Defaults to null.
Variable | Explanation |
---|---|
'tag' | Data tag |
'datarow' | The Index of data row. |
'row' | The Index of grid row. |
'state' | The state of data row. |
'prevval' | The same field value of previous row. |
'nextval' | The same field value of next row. |
'values' | Get the value by field name or field index of fields. |
'prevvals' | Get the value by field name or field index of fields of previous rows. |
'nextvals' | Get the value by field name or field index of fields of next rows. |
grid.setColumns([{
name: "colAmount",
type: "calced",
// You can directly use the field name in expression.
valueExpression: "unit_price * quantity"
},
...
]);