Results 1 to 6 of 6

Thread: Ext.data.Store getCount() = displayed, getTotalCount() = undefined on store

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Jan 2012
    Location
    Chicago
    Posts
    17

    Default 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!

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,450

    Default

    Are you returning the total in the response?
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Location
    Chicago
    Posts
    17

    Default

    Data populated in the child store is through drag drop only, no load is occurring.

  4. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,450

    Default

    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 @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  5. #5
    Ext JS Premium Member
    Join Date
    May 2009
    Location
    Illinois, USA
    Posts
    9

    Default

    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.

  6. #6
    Sencha User
    Join Date
    Jan 2012
    Location
    Chicago
    Posts
    17

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •