Display the total number of rows in a Slickgrid table

这一生的挚爱 提交于 2019-12-24 03:07:32

问题


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.


回答1:


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



回答2:


Use the onRowCountChanged for dataView argument in Slick Grid.

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


来源:https://stackoverflow.com/questions/16992444/display-the-total-number-of-rows-in-a-slickgrid-table

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!