probably is a stupid question but i really don't know now, what i have to do to localize a button in a window i just redefined and create. I use extjs 4.2.1 and i produce a kind of mvc but is more similar to the old way of use this type of framework.
I have to define a window that have two buttons 'submit' and 'close' like this:
Ext.define('newWindow',{
extend:'Ext.window.Window',
config: {
submitFn:function(){return null;}
}
bodyStyle: 'padding: 5px 5px 0',
layout:'fit',
width:460,
height:390,
plain: false,
border:false,
resizable: false,
buttons: [{
text:'submit',
handler: function(){this.up.up.submitFn()},
tabIndex:1000
},{
text: 'close',
handler: function(){
this.up().up().hide();},
tabIndex:1001
}]
})
When i create this window in my code i want to pass him a function to handler his behave but i can't.. i try to put him itemId, id but Ext.getCmp(id), Ext.ComponentQuery.query(id) doesn't do their job.
RE-EDIT:
OK the question isn't clear: I define in that way the components newWindow. I say i don't use the mvc pattern and in a part of my program i create this component in like here;
var dlg = Ext.create('newWindow', {submitFn: submit});
Where submit is the function i need to call to submit the value present in the window, with her logic. This is what i need to do but i ask all another way to do that.