The dynamic style object array in which has set Expression or Callback Function.
It will apply the style set which has passed after running the callback or expression in order and ignore the rest. It is similar to switch case of JavaScript. If callback exists in the corresponding location, the expression will be ignored. And, if do not set Style Set in the corresponding location, it will use the one which has been set before.
When add as setting objects in DataColumn.dynamicStyles, if there is "expressions" or "callbacks" property in setting object, it will be created as this object.
var columns = [{
name: 'colQty',
fieldName: 'quantity',
dynamicStyles:[{
expressions: [
"row % 5 == 0",
"row % 3 == 0"
],
styles: [{
shapeSize: size1,
numberFormat: fmt1
}, {
shapeSize: size2,
numberFormat: fmt2
}]
}]
}, {
callbacks: [
function (cell) {
return cell.rowIndex() % 5 == 0;
},
function (cell) {
return cell.rowIndex() % 3 == 0;
}
],
styles: [{
shapeSize: size1,
numberFormat: fmt1
}, {
shapeSize: size2,
numberFormat: fmt2
}]
},
...
];
grid.setColumns(columns);