gigas01
24 Jul 2012, 10:01 PM
I followed this sample code but has an error
Uncaught TypeError: Cannot call method 'getValues' of undefined MyPanel.js:195
Ext.applyIf.items.items.handler MyPanel.js:195
Ext.define.fireHandler ext-all-debug.js:29512
Ext.define.onClick ext-all-debug.js:29502
(anonymous function)
wrap
new Ext.form.Panel({
fullscreen : true,
items : [
{
xtype : 'fieldset',
title : 'Test',
items : [
{
xtype : 'textfield',
label : 'One',
name : 'one'
},
{
xtype : 'textfield',
label : 'Two',
name : 'two'
},
{
xtype : 'textfield',
label : 'Three',
name : 'three'
}
]
},
{
xtype : 'button',
text : 'Save',
ui : 'confirm',
handler : function(button) {
var form = button.up('formpanel'),
values = form.getValues();
Ext.Ajax.request({
url : 'data/form.php',
params : {
data : Ext.encode(values)
}
});
}
}
]
});
and this is my code
{
xtype: 'fieldset',
height: 128,
width: 632,
title: 'Enter New Activity',
url:BASE_URL + 'addActivity',
items: [
{
xtype: 'textfield',
fieldLabel: 'Activity',
anchor: '100%',
name: 'activityName'
},
{
xtype: 'button',
height: 37,
width: 53,
text: 'Save',
//ui: 'confirm',
handler: function(button) {
var form = button.up('form');
var values = form.getValues();
Ext.Ajax.request({
url:BASE_URL + 'addActivity',
params : {
data : Ext.encode(values)
}
});
}
}
],
}
Uncaught TypeError: Cannot call method 'getValues' of undefined MyPanel.js:195
Ext.applyIf.items.items.handler MyPanel.js:195
Ext.define.fireHandler ext-all-debug.js:29512
Ext.define.onClick ext-all-debug.js:29502
(anonymous function)
wrap
new Ext.form.Panel({
fullscreen : true,
items : [
{
xtype : 'fieldset',
title : 'Test',
items : [
{
xtype : 'textfield',
label : 'One',
name : 'one'
},
{
xtype : 'textfield',
label : 'Two',
name : 'two'
},
{
xtype : 'textfield',
label : 'Three',
name : 'three'
}
]
},
{
xtype : 'button',
text : 'Save',
ui : 'confirm',
handler : function(button) {
var form = button.up('formpanel'),
values = form.getValues();
Ext.Ajax.request({
url : 'data/form.php',
params : {
data : Ext.encode(values)
}
});
}
}
]
});
and this is my code
{
xtype: 'fieldset',
height: 128,
width: 632,
title: 'Enter New Activity',
url:BASE_URL + 'addActivity',
items: [
{
xtype: 'textfield',
fieldLabel: 'Activity',
anchor: '100%',
name: 'activityName'
},
{
xtype: 'button',
height: 37,
width: 53,
text: 'Save',
//ui: 'confirm',
handler: function(button) {
var form = button.up('form');
var values = form.getValues();
Ext.Ajax.request({
url:BASE_URL + 'addActivity',
params : {
data : Ext.encode(values)
}
});
}
}
],
}