ThiemNguyen
6 Apr 2012, 11:14 PM
Hello everyone,
I used Sencha Touch 2 to develop my app (relating to e-Commerce) for a few months and it's growing bigger and bigger. Now I want to optimize it to get better performance on native devices and the problem I'm concerned about now is how to keep the DOM as small as possible.
Basically, my app's HomePanel is a TabPanel which contains following tabs: Product (show all products available), Bookmark (show user's subscription) and Search. Obviously, the results from those tasks are similar: a product list, clicking on a product will show the details. Very simple.
But what I've done is quite stupid, like this:
- Define ProductListView and ProductDetailView as xtypes.
- In the Product tab items configs, include ProductListView, ProductDetailView
- Do the same for Bookmark and Search tabs.
So I think what I did is very memory-consuming: just creating all components and at each user's tasks, find and set appropriate view and set them as active. Moreover, the "destination" of Product, Bookmark and Search tasks is nearly the same, but I have to create that ProductListView and ProductDetailView 3 times ...
I'm quite sure there's something not ok but I'm not very experienced in Sencha Touch so I need help from you. What I want to do are:
- Minimizing the DOM by only storing necessary views for user's interactions.
- Avoiding creating items of the same types too many times.
Highly appreciate any helps. Thank you so much.
I used Sencha Touch 2 to develop my app (relating to e-Commerce) for a few months and it's growing bigger and bigger. Now I want to optimize it to get better performance on native devices and the problem I'm concerned about now is how to keep the DOM as small as possible.
Basically, my app's HomePanel is a TabPanel which contains following tabs: Product (show all products available), Bookmark (show user's subscription) and Search. Obviously, the results from those tasks are similar: a product list, clicking on a product will show the details. Very simple.
But what I've done is quite stupid, like this:
- Define ProductListView and ProductDetailView as xtypes.
- In the Product tab items configs, include ProductListView, ProductDetailView
- Do the same for Bookmark and Search tabs.
So I think what I did is very memory-consuming: just creating all components and at each user's tasks, find and set appropriate view and set them as active. Moreover, the "destination" of Product, Bookmark and Search tasks is nearly the same, but I have to create that ProductListView and ProductDetailView 3 times ...
I'm quite sure there's something not ok but I'm not very experienced in Sencha Touch so I need help from you. What I want to do are:
- Minimizing the DOM by only storing necessary views for user's interactions.
- Avoiding creating items of the same types too many times.
Highly appreciate any helps. Thank you so much.