"Pages" fuction is the light version of the PrevNext function. it is possible to do search results paging real easily. It is even more simple in use. If the name of the query for paging is "Results", sample piece of code using Pages function would look just like this:
<cfscript> g=createobject("component","com.cfc.GUI"); g.Pages(results); </sfscript>
That's is it :) It is flexible enough and accepts extra parameters as follows:
<CFARGUMENT name="maxrows" type="numeric" required="No" default="20"> <CFARGUMENT name="pagesinblock" type="numeric" required="No" default="10"> <CFARGUMENT name="borderstyle" type="string" required="No" default="border:solid 1px ##778899;"> <CFARGUMENT name="curpagestyle" type="string" required="No" default="background-color:lightgrey; font-weight:bold;">
where MAXROWS is number of rows listed per page, PAGESINBLOCK is how many boxed links to another next and previous pages it should show, BORDERSTYLE and CURPAGESTYLE are styles arguments to customize look. |