我有一个按钮,窗口中输入和几个字段我需要得到的数据表单的和有方法上的按钮:记录未定义Extjs4获取数据的表格
enter: function (button) {
var win = button.up('window'),
form = win.down('form'),
record = form.getRecord(),
values = form.getValues();
record.set(values);
win.close();
this.getUsersStore().sync();
这里记录未定义。我做错了什么? ///////////////////////////////////////////////// ///////////////////
下面的形式:
Ext.define('ExtMVC.view.portlet.Login', {
extend: 'Ext.window.Window',
alias: 'widget.login',
layout: 'fit',
title: 'LogIn',
width: 300,
height: 150,
autoShow: true,
store: 'LoginModels',
initComponent: function() {
this.items = [
{
xtype: 'form',
items: [
{
xtype: 'textfield',
name: 'Name',
fieldLabel: 'Name',
style: { 'margin': '10px' },
},
{
xtype: 'textfield',
name: 'Password',
fieldLabel: 'Password',
style: { 'margin': '10px' },
}
]
}
];
this.buttons = [
{
text: 'Enter',
action: 'enter',
//handler: this.enter
},
{
text: 'Cancel',
scope: this,
handler: this.close
},
{
text: 'Sing in',
scope: this,
handler: this.close
}
];
this.callParent(arguments);
}
});
不工作,设置() - 获取NULL – TimurYakov 2014-11-25 15:59:47
发表您的表单代码 – 2014-11-25 16:08:14
请参见我的文章//// – TimurYakov 2014-11-26 07:29:43