我正在尝试根据网格中的值在 DojoX (1.2.3) 网格内设置行的样式。
网格布局:
var view1 = {
noscroll: true,
rows: [{
field: 'TASK_ID',
name: 'ID',
width: '80px',
get: this.getColor
}, {
field: 'MENUPOINT',
name: 'Action',
width: '250px'
}]
};
获取颜色函数:
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);
});
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)