EXTJS4-修改后的记录未显示

时间:2018-06-25 18:40:51

标签: javascript extjs extjs4.2

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

我尝试使用getUpdatedRecordsgetModifiedRecords,但都没有正确填充。

如何正确实现这些方法?

代码

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

1 个答案:

答案 0 :(得分:0)

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

那应该工作。框架的目的是使您的工作变得更轻松而不难,因为调用sync方法应该因此获得更新的记录并将其传递给您的代理,然后由代理处理更新的数据

相关问题