Use the up() method to get the ancestor element (ie form):
{
xtype:'button'
,text:'Crear Bodega'
,listeners: {
'click' : function(){
// get the form type ancestor which contains the button
var myFormPanelObj = this.up('form');
var data = myFormPanelObj.getForm().getValues();
console.log("data: " + Ext.JSON.encode(data));
}
}
}
Resource:
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.button.Button-method-up
{
xtype:'button'
,text:'Crear Bodega'
,listeners: {
'click' : function(){
// get the form type ancestor which contains the button
var myFormPanelObj = this.up('form');
var data = myFormPanelObj.getForm().getValues();
console.log("data: " + Ext.JSON.encode(data));
}
}
}
Resource:
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.button.Button-method-up
No comments:
Post a Comment