Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No access to rowCount #232

Closed
bitpshr opened this issue Jul 18, 2012 · 4 comments
Closed

No access to rowCount #232

bitpshr opened this issue Jul 18, 2012 · 4 comments

Comments

@bitpshr
Copy link
Member

bitpshr commented Jul 18, 2012

I've been looking around the code for a rowCount or similar instance variable that indicates how many total results exist. With the DataGrid, I believe this was grabbed from a total, totalCount, or numRows parameter on the first results response object.

@karakk
Copy link

karakk commented Sep 3, 2012

Yes i would like to know also if there is a property that we could use to easily get the rowCount without doing any "fetches" from the store. It seems at first sight that there isn't any.

@kfranqueiro
Copy link
Member

Currently there's no direct property or event exposing this, but you can be informed of the total results any time the grid receives a new result set by aspecting onto renderArray:

aspect.after(grid, 'renderArray', function(results) {
    // do something with results.total here
}, true);

I'm open to suggestions as to whether this ought to be exposed as a property, or a custom event... exposing it as a property on the grid feels kind of odd, and it may actually be more useful to expose it as an event so that you can react to any time it changes. At the same time, the aspecting above isn't all that different but I'll admit it isn't the most obvious thing in the world.

@kfranqueiro
Copy link
Member

In dgrid 0.4, total will be retrievable via grid.get('total'). dstore's events enable us to more reliably keep up to date as the total changes when items are added/removed as well, and get('total') will reflect that.

@kfranqueiro
Copy link
Member

Resolved in 0.4 via b39ff7a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants