Dojo Enhanced grid with pagination need to access number of rows in the page

别说谁变了你拦得住时间么 提交于 2019-11-29 17:19:52

You can access the page size in dojo 1.6 using this:

yourGrid.pagination.plugin.pageSize;

Here is a working jsfiddle using dojo 1.6:

http://jsfiddle.net/SM8GS/1/

It uses the onClick event of the grid. Each time you click on the grid it alerts the current page size.

Please edit your initial question & add the dojo version to it !

Lucian

The documentation states that there is a currentPageSize() method. You can access it directly from the EnhancedGrid object. I made a JSFiddle to test this. At the bottom of the script you can find the following code:

// Display current page size
grid.on("RowClick", function() {
   alert(grid.currentPageSize());    
});

Change the pagesize and click any row to see the result.

The rest of the code is copy-pasted from the documentation just to get a simple example of the enhanced grid (no special tricks are involved).

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