我需要验证来自网格的信息:
- 检查将“required”列设置为“Yes”的所有行是否将“Status”列设置为“Received”。
如何遍历网格数据?
答案 0 :(得分:0)
我找到了答案:
var records = gridRequisitos.store.data.items,
obligatorio,
estadoReq;
requisitosCumplidos = true;
// are there any records?
if (records.length > 0) {
// traverse records
for (var i = 0; i < records.length; i++) {
// get specific columns
estadoReq = records[i].get('estadoRequisitoDescripcion');
obligatorio = records[i].get('obligatorio');
// if it's required and status == pending...
if (obligatorio == 'S' && estadoReq == 'Pendiente') {
requisitosCumplidos = false;
break;
}
}
}