SMART datagrid v.1 > Classes > DerivedField

[ grids ver.1.3.0]   Back  Forward

DataLudi.DerivedField.callback  property

Callback function which returns the value to be saved in field. 

function (ds:DataSet, fieldIndex, rowIndex, values:Array, source:Integer, temp:Boolean):*;

values is the array in which has saved the values of common field. source is the index of one field which has enabled to call this callback by GridDataSet.setValue or TreeDataSet.setValuetemp is transferred as true when calling this callback during editing grid row. You can also return the value by expression expression property instead of this callback function. (source and temp are in ver 1.3) 

Defaults to null.

Getter
function callback(): Function
Setter
function setCallback(value: Function)
Code -1
    var fields = [];
    var calcedFields = [
        {
            fieldName: "amount",
            callback: function (ds, fld, row, values) {
                return values[9] * values[10];
            }
        },
        ...
    ];
    ds.setFields(fields, calcedFields);
See Also
expression
sourceFields
DataSet.setFields
Examples
Derived Fields
Row Summary