如何在 extjs 4.0 中加载创建并将新记录加载到表单中
我正在使用 mvc 方法并扩展 pandora 示例。
我想向表单添加一条新记录。我需要预先分配一些属性。我有以下处理程序。填写表格。但是,当我尝试同步时,它不会发布新信息。即使用 fire bug,我看到它发布了以前存在的记录。我应该在什么阶段将其添加到商店。
onNewPartSelect: function (selModel, selection) {
var form = Ext.getCmp('partForm');
form.getForm().reset();
var part = new Pandora.model.Part({
Name: 'my new record'
});
form.loadRecord(part);
},
I'm using mvc approach and extending the pandora example.
I would like to add a new record to a form. I need to pre-assign some properties. I have the following handler. Which fills out the form. However when i try and sync it does not post the new info. ie using fire bug i see that it post the records that were previously there. At what stage should i add it to the store.
onNewPartSelect: function (selModel, selection) {
var form = Ext.getCmp('partForm');
form.getForm().reset();
var part = new Pandora.model.Part({
Name: 'my new record'
});
form.loadRecord(part);
},
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将新记录加载到表单中:
并在提交时:
For loading a new record into the form:
And upon submit: