Css 根据数据设置Dojox网格行的样式
我正在尝试根据网格中的值在DojoX(1.2.3)网格中设置行的样式 网格布局:Css 根据数据设置Dojox网格行的样式,css,dojo,grid,Css,Dojo,Grid,我正在尝试根据网格中的值在DojoX(1.2.3)网格中设置行的样式 网格布局: var view1 = { noscroll: true, rows: [{ field: 'TASK_ID', name: 'ID', width: '80px', get: this.get
var view1 = {
noscroll: true,
rows: [{
field: 'TASK_ID',
name: 'ID',
width: '80px',
get: this.getColor
}, {
field: 'MENUPOINT',
name: 'Action',
width: '250px'
}]
};
getColor函数:
getColor: function(inRowIndex) {
console.log(inRowIndex);
grid = dijit.byId('gridTaskCurrent');
// if task_id = 1 style row with other background(?)
},
我不知道如何从每一行中获取task_id值并为其设置样式
争吵。。如果有人有一个很好的链接或知道如何做。。那太好了。我自己买的:
dojo.connect(dijit.byId('gridTaskCurrent'), 'onStyleRow' , this, function(row) {
var item = grid.getItem(row.index);
if (item) {
var type = grid.store.getValue(item, "LOCKED", null);
if (type == 1) {
row.customStyles += "background-color:limegreen;";
}
}
grid.focus.styleRow(row);
grid.edit.styleRow(row);
});