PDA

View Full Version : a button handler should submit a component as a parameter and also a form



Sai Dasika
13 Apr 2010, 2:27 PM
Hello,
I am getting a syntax error when having a handler which submits a form and also send a component as a parameter.

The following is my code:
var Window= new Ext.Window({
autoHeight:true,
width:800,
autoScroll:true,
items:[Form],
buttons:[
{
name:'Submit',
text:'Submit',

handler:function()
{
Window.hide();
Form.getForm().submit({
params: Ext.getCmp('EntropyParams').value,
disableCaching: true,

success: function(result, request) {

window.open( "entropyHandler.ashx?query=temperature" , 'entropy', 'resizable=1', false);
},
failure: function(result, request) {
Ext.ent.msgbox.msg("Failed");
}
});

}
},
{
name:'Cancel',
text:'Cancel',
handler:function()
{
Window.hide();
}
}]
});


When i use this i am getting an error in firebug console: syntax error
() ext-all.js(line 7)

MiamiCoder
14 Apr 2010, 11:31 AM
One thing I see here is that params needs to be an object. Check out BasicForm's docs http://www.extjs.com/deploy/dev/docs/?class=Ext.form.BasicForm.