SMART datagrid v.1 > Classes > DynamicStyleCase
样式列表。
如果通过指定为callbacks或expressions的判断与否,就会反映指定在该列表的属性。 如果没有在callbacks或expressions,指定相当于各个项目的位置的styles,就会使用上述设置的样式组。
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);