Last post Jul 10, 2013 10:25 AM by 1jus
Feb 07, 2012 06:06 PM|yousaid|LINK
After reading this Tutorial,
I created a Page. All I changed was the Sql and af few other stuff. The page works. So my question is, How will the user get to view records past the Page size of 10?
That is, what happens to records past the Default page Size?
Feb 07, 2012 06:59 PM|Mikesdotnetting|LINK
I'm not sure what you are asking. The user will click on the paging links to navigate to the next page worth of records. Or are you asking about how to increase the default page size? You could do it by providing the user with a dropdown and pass the posted
value to the pageSize variable.
Feb 07, 2012 07:17 PM|yousaid|LINK
Thanks Mike, my question is, when you look at the Sample provided in the tutorial, the Page size is set to 10.
If I understand correctly, the page size sets the Number of Pages to be shown to the number chosen, in this case 10. So 10 pages are initially displayed when the page loads.
Now suppose I have more record that cannot fit into this 10 pages, meaning there are pages 11, 12, 13 etc.
How will the user get to see these pages, beyond 10? I was expecting the paging link to say something like .....Next 10 pages AFTER the initial 10 pages. That is, The user clicks on the last page in the Paging link (page 10 in the example), then the Following
10 pages are then displayed. BUT I don't see that. Am I missing something?
Feb 07, 2012 07:24 PM|Mikesdotnetting|LINK
Oh, I see. No - the pageSize represents the number of records that get displayed per page. totalPages represents the number of pages required to display all the records that meet the criteria in the SQL. It's calculated by dividing the total number of records
by the records per page (pageSize).
Feb 07, 2012 07:42 PM|yousaid|LINK
Thanks again Mike !!
But how can one know before hand the number of Pages required to to meet the criteria.
Imagine for instance a Forum where users are constantly adding records. How can one predict the this?
Can you please point me to a sample.
Using the downloaded sample, I can set the
var totalPages = 20 (anticipating I will have that much records,) BUT what if I have more than that?
I noticed you set the
var totalpages = 0. Any reason why?
Feb 07, 2012 08:04 PM|Mikesdotnetting|LINK
The total number of records are obtained through a SELECT COUNT query:
var sql = "SELECT COUNT (*) FROM Customers";
count = db.QueryValue(sql);
totalPages = count/pageSize;
Jul 10, 2013 10:25 AM|1jus|LINK
Hi Guys, I know this is an old post but I'm making good use of the comments here and wondered what the best way to limit the number of pager links displayed.
As with the forum scenario, lets say you have a page count of 100, the UI would become very cluttered if we displayed 100 pager links.
I'm trying to get my head round the math invloved in displaying just 5 pager links but allowing the user to select +5 more or -5 less as appropriate.
Any ideas, welcomed :)