Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display the total number of rows in a Slickgrid table

Tags:

slickgrid

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.

like image 841
nathasm Avatar asked Nov 16 '25 10:11

nathasm


2 Answers

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
like image 174
Premshankar Tiwari Avatar answered Nov 19 '25 08:11

Premshankar Tiwari


Use the onRowCountChanged for dataView argument in Slick Grid.

dataView.onRowCountChanged.subscribe(function (e,args)
{
   $("#RowCount").text(args.current);
});
like image 35
Jeeva Kannan Avatar answered Nov 19 '25 08:11

Jeeva Kannan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!