labelField is the simplest implementation type for Data Lookup. It will display the field value specified through labelField property rather than the original data field value in the column cells.
In the grid below, "National currency" column specifies "country_currency" field as labelField.
At this point, if editing starts after the initial load of the data set, appropriate synchronization may be needed, and you can change the value of label field in GridDataSet.onRowUpdated or onRowInserted event in the data set level, and change and proceed the value corresponding to label field within GridBase.onEditCellUpdated event to synchronize in the editing grid row.
dsMain.onRowUpdated = function (ds, row) {
ds.setValue(row, 'country_currency', ds.getValue(row, 'country') + '_' + ds.getValue(row, 'currency'));
};
dsMain.onRowInserted = function (ds, row) {
ds.setValue(row, 'country_currency', ds.getValue(row, 'country') + '_' + ds.getValue(row, 'currency'));
};
grdMain.onEditCellUpdated = function (grid, row, fieldIndex, newValue, oldValue) {
var f1 = dsMain.getFieldIndex('country');
var f2 = dsMain.getFieldIndex('currency');
if (fieldIndex == f1 || fieldIndex == f2) {
row.setValue(dsMain.getFieldIndex('country_currency'), row.getValue(f1) + '_' + row.getValue(f2));
}
}
In order to move labelField to work, DataColumn.lookupDisplay should be specified as true. And, you can also use Derived Fields to implement easily.