ExtJS(网格):如何遍历网格的数据

发布于 2024-09-04 05:48:27 字数 82 浏览 2 评论 0原文

我需要验证来自网格的信息:
- 检查是否所有将“必需”列设置为“是”的行、将“状态”列设置为“已接收”。

如何遍历网格的数据?

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".

How do I traverse the data of the grid?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

卸妝后依然美 2024-09-11 05:48:27

我找到了答案:

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

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;
        }
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文