質問
iamは、グリッドの値に応じてDojoX(1.2.3)グリッド内の行をスタイルしようとしています。
GridLayout:
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);
});
所属していません StackOverflow