Steve88
10 Feb 2012, 1:42 AM
Hi all.
I'm a new member and Extjs is fantastic!! :))
I have a question about a syncRequire js...
After a button click, i istanciate a js file with the syncRequire.
Ok it work very well!! It open a window with 2 buttons.
My problem is:
I need to 'destroy' the required js in the beforeclose event.
What event i should use?
Ext.destroy('MyApp.views.MyGeo.MyGeojs') not work :(
Thank you all! :)
Ext.define('MyApp.views.MyGeo.MyGeojs', {
extend : 'Ext.Window',
height : 300,
width : 600,
border : false,
layout : {
type : 'hbox'
},
initComponent : function() {
this.items = this.buildItems();
this.callParent();
},
listeners :
{
beforeclose : function()
{
//Here i need to destroy the required 'MyApp.views.MyGeo.MyGeojs'
}
},
buildItems : function() {
return [
{
xtype: 'button',
width: 380,
text: 'Button 1',
handler: function(){
alert('Button 1 pressed!');
}
},
{
xtype: 'button',
width: 220,
text: 'Button 2',
handler: function(){
alert('Button 2 pressed!');
}
}
];
}
});
I'm a new member and Extjs is fantastic!! :))
I have a question about a syncRequire js...
After a button click, i istanciate a js file with the syncRequire.
Ok it work very well!! It open a window with 2 buttons.
My problem is:
I need to 'destroy' the required js in the beforeclose event.
What event i should use?
Ext.destroy('MyApp.views.MyGeo.MyGeojs') not work :(
Thank you all! :)
Ext.define('MyApp.views.MyGeo.MyGeojs', {
extend : 'Ext.Window',
height : 300,
width : 600,
border : false,
layout : {
type : 'hbox'
},
initComponent : function() {
this.items = this.buildItems();
this.callParent();
},
listeners :
{
beforeclose : function()
{
//Here i need to destroy the required 'MyApp.views.MyGeo.MyGeojs'
}
},
buildItems : function() {
return [
{
xtype: 'button',
width: 380,
text: 'Button 1',
handler: function(){
alert('Button 1 pressed!');
}
},
{
xtype: 'button',
width: 220,
text: 'Button 2',
handler: function(){
alert('Button 2 pressed!');
}
}
];
}
});