我有一個按鈕,窗口中輸入和幾個字段我需要得到的數據表單的和有方法上的按鈕:記錄未定義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