-
12 Mar 2012 7:07 PM #1
Unanswered: Reset the paging params (start, page) on list render
Unanswered: Reset the paging params (start, page) on list render
I have a category list and a product list. When the category list is clicked, a new panel with a list of products is displayed which is paged. When a back button is clicked back to categories, the product list is destroyed.
I am finding that when another category is clicked and the product list loads, the list paging params are not being reset. The same store is being used, but the data is being cleared.
Is there anyway to reset the paging params such as start and page?
Code:this.list = new Ext.List({ store: 'LocalProductsStore', plugins: [{ ptype: 'listpaging', autoPaging: false }], singleSelection: true, emptyText: '<p class="no-products">No products found matching this criteria.</p>', itemTpl: atd.templates.ProductListItem, listeners: { selectionchange: {fn: this.onSelect, scope: this} } });
-
13 Mar 2012 5:34 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,666
- Vote Rating
- 435
- Answers
- 3109
loadPage(0) on the store.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
11 Apr 2012 6:18 AM #3
I think you meant to say loadPage(1)
-
29 Oct 2012 3:01 AM #4
This unfortunately fires a new request.
Is there no way likeor something?Code:Ext.getCmp("ListPaging").clearParams()
-
29 Oct 2012 4:28 AM #5
What I did is a bit hacky but works for now.
I'm setting a store variable called needsReset to false and when I need to reset the params I obviously callthe in my stores' beforeload listener I check for that variable and if true I call store.loadPage(1), re-set my variable to false and return false;Code:store.setNeedsReset(true)
This causes the proxy to stop loading the actual call and calles a new one with parameters for page 1.Code:if (store.getNeedsReset()){ store.setNeedsReset(false); store.loadPage(1); return false; }
This is dirty and I need to digg through this again later...


Reply With Quote