开发者

ExtJS (Grid): How do I traverse the data of a Grid

I need to validate information from a grid:

- check if all the rows that have the "required" column set to "Yes", have the "Status" column set to "Received". 开发者_Go百科

How do I traverse the data of the grid?


I found the answer:

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;
        }
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜