-
26 Mar 2012 7:31 AM #1
Ext.data.Store getCount() = displayed, getTotalCount() = undefined on store
Ext.data.Store getCount() = displayed, getTotalCount() = undefined on store
Sencha Designer
Version: 2.0.0 Build: 337
Release Channel: 2.0-beta
-----------------------------------------------------------
Page with Parent Ext.data.Store and child Store filtered using pk of parent.
Child loading 1 row from JSON reader. After load:
childstore.getCount() = childstore.data.length = 1.
childstore.getTotalCount() = childdata.totalCount = undefined.
childstore.getRange() returns1 record.
Change parent row and Add N rows to store via dragDrop and filter store based on key of parent.
childstore.getCount() = childstore.data.length = N.
childstore.getTotalCount() = childdata.totalCount = undefined.
childstore.getRange() returns N records (not all in cache).
Prior version:
Change parent row and Add N rows to store via dragDrop and filter store based on key of parent.
childstore.getCount() = childstore.data.length = N.
childstore.getTotalCount() = childdata.totalCount = N+1.
childstore.getRange() returns N + 1 records (all in cache).
What has happened?
Thank you!
-
26 Mar 2012 9:56 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
Are you returning the total in the response?
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.
-
26 Mar 2012 11:07 AM #3
Data populated in the child store is through drag drop only, no load is occurring.
-
26 Mar 2012 11:15 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
Ok, getTotalCount will return the total property in the response. getCount will return what is in the store which for local data will be the total.
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.
-
26 Mar 2012 12:13 PM #5
My experience is that getTotalCount may be better titled getInitialLoadCount as it seems to retain the count when the store was first loaded. And getCount may be referred to as getFilteredCount as it shows the number of rows in the current filtered set. Missing is a method to return the complete number of rows in the javascript object, i.e. the Data.Store.
-
26 Mar 2012 12:43 PM #6
Constructive last comment. That is representative of the what is actually being returned and since my goal is to determine the total count in the data store regardless of state or how they were added (to do further client side work before sending to server) I seem to be left without an accessor method, or a reference to the data. Working with a data store with contents built locally does not seem to be considered relative to how to gain access to the entire set of data in the store and the number of records that I can find. "store".getRange() would return such a set at one point but no longer seems to return more than what is displayed when no arguments are provided.
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote