Friday, April 20, 2012

ExtJS4: get values from ExtJS form

Use the form.getValues() Method:

var  myFormPanelObj  = Ext.getCmp("myFormPanelId");
var data  =   myFormPanelObj.getForm().getValues();  
console.log("data: " + Ext.JSON.encode(data)); // {field1name : "field1value" , field2name : "field2value"}

References:
http://www.sencha.com/forum/showthread.php?62958-ExtJs-Jquery-form-submit

No comments: