PDA

View Full Version : multipage application in extjs4



bennyl
11 Jan 2012, 1:34 AM
hi all,

i have an application which composed of several screens
i want to be able to switch screens
and whenever i switch to a screen the old screen controller should be disposed and the new screen controller should be created

i figure out how to dispose the view of the screen (if i wrap it inside a container all i need is to dispose the container)
but how can i unload/load controllers?
how can i unregister all the events that the controller registered to?

or is there other way to create multi-screens application in extjs4?

vadimv
11 Jan 2012, 2:13 AM
> or is there other way to create multi-screens application in extjs4?
there's card layout wich works in one page(browser's) but has multiviews, and you can switch between them.....

bennyl
11 Jan 2012, 6:28 AM
vadimv,
thanks for the fast response

this mean that i have to construct all the controllers from the start => all the views from the start
i have 20 different screens, and one of them should be (didn't build it yet.. ) pretty big and intensive
isn't it an overkill? (both on performance and on load time)

i thought about maybe build only one (real) controller
and other "dynamic controllers" which will be just a normal objects (will not inherit from controller) and then i should register and unregister to all the events manually (without using the system event bus) but i think it such a waste to not use such a nice architecture... (also i still don't know how to unregister to an event... )

there must be some sort of way to dynamically add and remove screens + controllers (and to unregister event handlers )

vadimv
11 Jan 2012, 7:42 AM
vadimv,
thanks for the fast response

this mean that i have to construct all the controllers from the start => all the views from the start
i have 20 different screens, and one of them should be (didn't build it yet.. ) pretty big and intensive
isn't it an overkill? (both on performance and on load time)

yes, this is how card layout works, all views are loaded at the beginning, I tested with 7 cards/views(panels,views and one grid) of a medium level(templates, the layout) and no problems, about your case don't know, could be an overkill.

Regarding your thoughts, have no experience. I remember there were discussion on forum with sth related or close, try to search.

bennyl
11 Jan 2012, 7:51 AM
vadimv,
thanks again for your help it really appreciated

im searching all day :)
i found several close questions but most of them are not regarded to extjs 4
also there seems to be no final/ working answer that match my situation ...

i will continue searching and if i will find a lead i will post it here...

boofman15
18 Jan 2012, 8:07 AM
hello bennyl ... I was wondering if you found any best practices that helped answer your question proposed in this thread.

thanks.