-
18 Nov 2011 7:03 AM #1
Answered: [PR2] Multiple opened views couse performance problem
Answered: [PR2] Multiple opened views couse performance problem
I observed a strange behavior with opening some view for many times and I want to know is it normal..
When I switch my view with:
In page resources there are created component with id for example:Code:Ext.Viewport.setActiveItem({ xtype: 'myviewwidget'});
I switch now my view to another, but this component stays in page code. I checked it in PR1 release and the same situation is there, BUT...Code:id = "ext-myviewwidget-1"
In PR2 when I open many views, speed of my application slows a lot. In PR1 application still works like a charm.
I want to know if that strange problem is coused by my bad component initialization, or mayby I need to somehow destroy earlier created components when I switch view to another?
What is the best practice? Or mayby it's a PR2 bug which would be fixed in next release?
-
Best Answer Posted by Surykat
The problem was coused by selectfield listeners of 'change' event, which was loaded every time the view was created (there was couple of sort methods and binding).
I rewrite that listeners to MVC pattern (into controller class) and problem is gone.
-
18 Nov 2011 9:15 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,170
- Vote Rating
- 33
- Answers
- 83
Can you post an example for the dev team to toy with?

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
21 Nov 2011 1:32 AM #3
Is it possible that it is coused by my modification of not deleting listeners during constructor which i described in that topic?
http://www.sencha.com/forum/showthread.php?155631-PR2-delete-config.listeners-purposeful-behavior
I tried to build a simple solution to show that example but I didn't notice nothing strange in performance with original source of PR2 ;/ Now I'm trying to modify a project to not use a hard binded listeners but to wrap that code in controller.
-
21 Nov 2011 2:39 AM #4
The problem was coused by selectfield listeners of 'change' event, which was loaded every time the view was created (there was couple of sort methods and binding).
I rewrite that listeners to MVC pattern (into controller class) and problem is gone.


Reply With Quote