首页 > 解决方案 > EXTJS4 - 修改后的记录不显示

问题描述

我有一个启用了 CellEditing 的网格,当我单击“保存”时,我想捕获用户更改的所有内容。

我尝试使用getUpdatedRecords并且getModifiedRecords都没有正确填充。

如何正确实施这些方法?

代码

...
    saveGrid: function () {
            var controller = this,
                accManagerStore = Ext.getStore('Management'),
                modifiedRecords = (accManagerStore && accManagerStore.getUpdatedRecords()),
                modifiedRecords2 = (accManagerStore && accManagerStore.getModifiedRecords()),
                testDataWindow = controller.view,
                activeRec = controller.activeRecord,
                assetId = (activeRec && activeRec.get('assetId')),

                resultsArray = [];

            this.getAccountManagementGrid().getStore().sync();


        },...

安慰

modifiedRecords: []
​​
length: 0
​​
__proto__: []
​
modifiedRecords2: []
​​
length: 0

标签: javascriptextjsextjs4.2

解决方案


... saveGrid: function () { var controller = this, accManagerStore = Ext.getStore('Management'), accManagerStore.sync()

那应该可行。框架的目的是让您的工作更轻松,而不是更难调用同步方法因此应该获取更新的记录并将其传递给您的代理,然后代理将处理更新的数据


推荐阅读