nathasm
nathasm

Reputation: 2574

Display the total number of rows in a Slickgrid table

Is there an accepted way to display the total number of rows in a slickgrid table. I see that there is a pager that I can include on my pages, but that comes with additional buttons/settings for pagination.

I am using a DataView object with no grouping. Ideally I'd like to simply have a trivial row at the bottom of the viewport that lists how many rows are in the table.

I could do this manually but wasn't sure if I was missing something in the Slickgrid APIs/configuration.

Upvotes: 3

Views: 7397

Answers (2)

Jeeva Kannan
Jeeva Kannan

Reputation: 137

Use the onRowCountChanged for dataView argument in Slick Grid.

dataView.onRowCountChanged.subscribe(function (e,args)
{
   $("#RowCount").text(args.current);
});

Upvotes: 1

Premshankar Tiwari
Premshankar Tiwari

Reputation: 3106

Use this method...to get number of rows displayed in the grid..(if no pagination is there)

grid.getDataLength();

if pagination is there....use this..

grid.getData().getPagingInfo().pageNum
grid.getData().getPagingInfo().pageSize
grid.getData().getPagingInfo().totalPages
grid.getData().getPagingInfo().totalRows   //  what u want

Upvotes: 6

Related Questions