javascript - 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
解决方案
...
saveGrid: function () {
var controller = this,
accManagerStore = Ext.getStore('Management'),
accManagerStore.sync()
那应该可行。框架的目的是让您的工作更轻松,而不是更难调用同步方法因此应该获取更新的记录并将其传递给您的代理,然后代理将处理更新的数据
推荐阅读
- bash - zsh 中 \[ ... \] 的等价物是什么?
- elasticsearch - 在布尔查询中嵌套 function_score
- performance - Apache Spark 2.4:为什么会有“无广播”?
- javascript - 将值解析为函数时出现空响应,卡在上面。有什么我想念的吗?
- entity-framework-core - 字符串参数可为空生成错误的sql查询
- python - 无法使用代码运行子进程,command 在终端上工作
- vue.js - 运行 VueJS 项目时出现 NET::ERR_CERT_INVALID 错误
- reactjs - 如何使用 Material-UI 创建这种可滚动的网格状视图?
- html - 如何修复表格溢出以使其自动滚动?
- javascript - nodejs express删除和更新不适用于AngularJS中的一个组件?