【问题标题】:EXTJS4 - Modified records not showing upEXTJS4 - 修改后的记录不显示
【发布时间】:2018-06-25 18:40:51
【问题描述】:

我有一个启用了 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

【问题讨论】:

  • 已经有一段时间了,但我认为您必须说 UpdateRecord 才能将更改从您的表单推送回您的记录。

标签: javascript extjs extjs4.2


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-07-02
    • 2020-01-24
    • 2018-06-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-31
    • 1970-01-01
    相关资源
    最近更新 更多