Estilo Dojox Grid Row según los datos
Pregunta
iam tratando de diseñar una fila dentro de una cuadrícula DojoX (1.2.3) dependiendo de los valores de la cuadrícula.
GridLayout:
var view1 = {
noscroll: true,
rows: [{
field: 'TASK_ID',
name: 'ID',
width: '80px',
get: this.getColor
}, {
field: 'MENUPOINT',
name: 'Action',
width: '250px'
}]
};
Función getColor:
getColor: function(inRowIndex) {
console.log(inRowIndex);
grid = dijit.byId('gridTaskCurrent');
// if task_id = 1 style row with other background(?)
},
Y no tengo idea de cómo obtener el valor task_id de cada fila y establecer un estilo para la fila ... si alguien tiene un buen enlace o sabe cómo hacerlo ... sería genial.
Solución
Lo tengo solo:
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);
});
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow