i've set a timer in status bar. but the problem is that when i close the window , it finds error. how do i close the window without any error in extjs 4 .........
here is my view. it works
var clock = Ext.create('Ext.toolbar.TextItem', { text: Ext.Date.format(new Date(), 'g:i:s A')}),
this. bbar= Ext.create('Ext.ux.StatusBar', {
id: 'win-statusbar',
topBorder:false,
text:'Status',
defaultIconCls: 'info',
defaultText: 'Status',
items: [clock]
});
this.listeners= {
render: {
fn: function(){
var task= Ext.TaskManager.start({
run: function(){
Ext.fly(clock.getEl()).update(Ext.Date.format(new Date(), 'g:i:s A'));
},
interval: 1000
});
}
}
};
controller. how to set ' Ext.TaskManager.stop()' here before close the window.
doClose: function (button) {
var win = button.up('window');
win.close();
}
errors
Ext.fly(clock.getEl()) is null