SMART datagrid v.1 > Classes > DerivedField
DataLudi.DerivedField.sourceFields property
Calculate again only when the fields specified in this property have been changed.
You can specify one field as field name or field index, and can also specify one or more field name or index as array.
Defaults to null.
- Getter
- function sourceFields(): [Integer]
- Setter
- function setSourceFields(value: Integer|String|[Integer|String])
- Note
- When calling GridDataSet.setValue, TreeDataSet.setValue or only when specifying field index greater than 0 in field parameter of GridDataSet.insertRow, TreeDataSet.insertRow, this property will be meaningful.
- In most cases, only when setting EditOptions.updateByCell, insertByCell as true in grid to commit in cell unit, you can use this property meaningfully.
- When calling GridDataSet.updateRow, all fields will be transferred to data set as changed state.
Code -1
var fields = [...];
var calcedFields = [{
fieldName: "amount",
expression: "qty * price",
sourceFields: ["qty", "price"]
}];
ds.setFields(fields, calcedFields);
- See Also
- expression
- callback
- GridDataSet.setValue
- GridDataSet.insertRow
- TreeDataSet.setValue
- EditOptions.updateByCell
- EditOptions.insertByCell
- Examples
- Derived Fields