Hello folks,
I'm really new to ExtJS and run right into a problem:
I would like to destroy or switch a Controller after pushing a button.
This should be made without a page refresh - just a reload of the content.
I searched the forum and the web but found anything useful.
In detail:
I got the two controllers 'Search1.js' and 'Search2.js'. Search1 is initialized at the start of the application.
After pushing the button, I would like to change from Controller Search1 to Controller Search2.
-------
What I understand so far:
It's not really possible to "destory" a Controller, after it's inizialized, because the method destroy doesn't exist in it's context (http://docs.sencha.com/ext-js/4-1/#!...app.Controller).
What I got so far:
- I'm able to initialize a class via pushing a button in the Viewport-context.
- It works without refreshing the page, just reloading the data.
I tried many things but they all where no help for me.
My last try ended up like this (part of the Viewport.js-context):
Code:
{
xtype : 'button',
ident : 'MindControll',
itemId : 'changeButton',
componentCls : 'change-button-caption',
height : 25,
margin : '0 0 0 3',
text : 'ChangeController',
handler: function() {
App_SearchController1.destroy;
App_SearchController2.init();
console.log('App_SearchController1', App_SearchController1);
console.log('App_SearchController2', App_SearchController2);
}
}
Is it even possible to change the active Controller or is there another (much better) way to realize what I need (without tabs)?
In my opinion it isn't the right way how to solve this task but it's the only thing I could imagine.
I hope you can help me - and thanks in advance.
Greetings
Zeitwaechter