Forum

HomeHomeCoreCoreGeneralGeneralPagerPager
Previous
 
Next
New Post
8/5/2011 11:01 AM
 

Here's a hacked up version of nxtrack's script, but using the new PAGER token for reference...

 TJ

 Pager-using-New-Pager-Token.txt
New Post
8/5/2011 12:31 PM
 
Re: Pager  Modified By adski  on 8/6/2011 6:51:45 PM

Dam you beat me to it ;)

Anyway here is my super doopa example of using the new "PAGER" token!

It includes both "normal paging with postbacks" & "fast ajax paging".

Most variables are done using sql so it is easy to manage.

MWD.OWS.PagerSample(WORKING!)V2


R2i: Here are some suggestions on how I think you could improve the "PAGER" token to make it even more flexible:

  1. Currently you have to use "[PageSize,System]" to set how many records per page (this pulls the "records per page" from the modules config settings). It would be better it we could set this manually in our SQL so that we can use different "records per page" in a single config. For example a popup window may require their own "records per page" that is different from the original config.

    CURRENTLY I HAVE TO DO:
    SET @MWD_RecordsPerPage = [PageSize,System];

    IT WOULD BE MORE FLEXIBLE IF WE COULD DO:
    SET @MWD_RecordsPerPage = 10;

    FIXED IN "MWD.OWS.PagerSample(WORKING!)V2" - My mistake & not a bug in OWS!
     
  2. Currently we only have "Back" & "Next" buttons. It would be awesome if we could also have "First" & "Last" buttons too ;)
    FIXED IN "MWD.OWS.PagerSample(WORKING!)V2" - Implimented TJ's suggestion for "First" & "Last" buttons!
     
  3. Maybe look at changing the #PAGE# variable as you cannot do math with it as OWS now thinks it is a date because of the #'s.
New Post
8/5/2011 12:38 PM
 
sexy-trousers wrote:
It seems like the "Pages" option on the PAGER token doesn't act in the same manner as the "Pages" option on the lxPager token... "Pages" on lxPager limits the max. no. of pages shown on the pager at any one time, whereas the "Pages" option on the PAGER token seems to require the total number of pages the pager is to page through, so it appears the PAGER syntax is likely to list a huge number of links in the case of large datasets (unless I'm missing something), i.e. if you return a result set that has 100 pages then the page under the PAGER action will list ALL 100 pages in the pager - is that right? Am I missing something? Is there another option that limits/truncates the no. of pages shown in the PAGER token? If not, then it seems the only useful option is use the older lxPager token... Thanks, TJ.

If you look at the example I just posted I found a "SHOW" variable when I was looking through the source code.

You can use it like - Show="9" (this will only show 9 page numbers instead of them all).

{PAGER,
Current="[MWD_CurrentPage,Table1]",
Pages="{MATH,"CEIL([MWD_TotalRows,Table6]/[MWD_RecordsPerPage,Table4])"}",
Show="[MWD_NumberOfPageLinks,Table5]",
Format="<span class=\"PagingLink\"><a href=\"\[CurrentURL,Action\]?PageNumber=#PAGE#\" >#PAGE#</a></span> ",
CurrentFormat="<span class=\"PagingLink ActiveLink\"><a href=\"\[CurrentURL,Action\]?PageNumber=#PAGE#\" >#PAGE#</a></span> ",
PageDelimiter="",
Delimiter="",
LeftFormat="<span class=\"PagingLink\"><a href=\"\[CurrentURL,Action\]?PageNumber=[MWD_PreviousPage,Table2]\">« Prev </a></span> ",
DisabledLeftFormat="<span class=\"PagingLink DisabledLink\">« Previous</span> ",
RightFormat="<span class=\"PagingLink\"><a href=\"\[CurrentURL,Action\]?PageNumber=[MWD_NextPage,Table3]\">Next »</a></span> ",
DisabledRightFormat="<span class=\"PagingLink DisabledLink\">Next »</span> ",
EmptyFormat=""
}

New Post
8/6/2011 1:29 PM
 

Good to know about the Show option - I was meaning to crack the source open, but ran out of time (and in reality shouldn't have to).

I wonder if we can put together a bounty or all pitch in so someone in the know at R2i could complete some OWS documentation - I don't know about the rest of you, but I pretty much use the old ListX docs as the Wiki seems to be getting less and less useful (particularly after the most recent redesign of the OWS website).

TJ

New Post
8/6/2011 1:44 PM
 
adski wrote:


R2i: Here are some suggestions on how I think you could improve the "PAGER" token to make it even more flexible:

  1. Currently you have to use "[PageSize,System]" to set how many records per page (this pulls the "records per page" from the modules config settings). It would be better it we could set this manually in our SQL so that we can use different "records per page" in a single config. For example a popup window may require their own "records per page" that is different from the original config.

    CURRENTLY I HAVE TO DO:
    SET @MWD_RecordsPerPage = [PageSize,System];

    IT WOULD BE MORE FLEXIBLE IF WE COULD DO:
    SET @MWD_RecordsPerPage = 10;
     
  2. Currently we only have "Back" & "Next" buttons. It would be awesome if we could also have "First" & "Last" buttons too ;)
     
  3. Maybe look at changing the #PAGE# variable as you cannot do math with it as OWS now thinks it is a date because of the #'s.

 ----

@adski - As for 1) above - whats to stop you from using your own value - I'm following you on your suggestion. As your in control of the query, can't you use or pull in any value you want?

I was also thinking about 2) above. Given you already know how many pages the pager has through the CEILING/MATH and you simply pass a page parameter via the URL, you could simply add a First/Last link into the LEFTFORMAT and RIGHTFORMAT options in the PAGER token to accomplish the same functionality - just a thought.

TJ

Previous
 
Next
HomeHomeCoreCoreGeneralGeneralPagerPager


 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seattle, WA • 410.327.0007 • info@R2Integrated.com

Bookmark & Share Bookmark and Share