Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
726 views
in Technique[技术] by (71.8m points)

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

I am implementing Dojo EnhancedGrid with pagination and there is something called items per page.

10 | 20 | 30 | 40  | 50| all.

Suppose I select here 20 in the EnhancedGrid pagination. How to access the value 20 from the program? I want to get this value and store it in a variable say Page-size. I am using Dojo version 1.6.1

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.8k users

...