-
18 May 2012 8:30 AM #1
Answered: Get List of records from my store
Answered: Get List of records from my store
Hi everbody, I have a question, How I can get a list of records filter by the function "filter" in my store?
Something like this:
1.png
Hope you can help me.Code:var mat = 10 var newStore = repartoStore.findRecord('matPosicion', mat); (only returns the first match, is not my case, I want a list) var newStore = repartoStore.data.filter('matPosicion',mat); (return items[0])
Thanks in advance!
-
Best Answer Posted by mitchellsimoens
Are you wanting to change what data is in the store? If so then you can use filter but if not then I wouldn't use filter. I would iterate through the store and add records to an array..
Code:var arr = []; store.each(function(rec) { if (something here) { arr.push(rec); } });
-
21 May 2012 6:23 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
- Answers
- 3157
Are you wanting to change what data is in the store? If so then you can use filter but if not then I wouldn't use filter. I would iterate through the store and add records to an array..
Code:var arr = []; store.each(function(rec) { if (something here) { arr.push(rec); } });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.
-
23 May 2012 1:29 PM #3
Man, you'r the best, thank you so much for your help.


Reply With Quote