Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Customising the look of pagination has always been a bitc...... a bit difficult. Lets make it easier shall we.

MEET, farPagination.cfc

CALL PAGINATION USING THE TAG:

<skin:pagination qRecordSet="qAllMyCustomers">
   <cfdump var="#stObject#" expand="false" label="stObject" />
</skin:pagination>

TO CUSTOMISE THE PAGINATION OUTPUT, CREATE YOUR OWN farPagination webskin. The default is displayLinks.cfm

<cfoutput>
<div class="pagination">
<p>
  <skin:buildPaginationLink stLink="#getLink('first')#" />
  <skin:buildPaginationLink stLink="#getLink('previous')#" linkText="<<" />

  <cfloop from="#getPageFrom()#" to="#getPageTo()#" index="i">
    <skin:buildPaginationLink stLink="#getLink(i)#" />
  </cfloop>

  <skin:buildPaginationLink stLink="#getLink('next')#" linkText=">>" />
  <skin:buildPaginationLink stLink="#getLink('last')#" />
</p>
<h4>Page #getCurrentPage()# of #getTotalPages()#</h4>
</div>
</cfoutput>

EXAMPLE CODE:

<skin:pagination
query="#yourquery#"
typename="yourtypename"
recordsPerPage="#stobj.numitems#"> 
	
<skin:view objectid="#stobject.objectid#" typename="yourtypename" webskin="#stObj.displaymethod#" />

</skin:pagination>

Basically the skin:pagination tag manages the loop, and provides you
with a new #request.stobject# variable with the contents of the
current row each loop. You can rename this variable using the
r_stobject="myVar" attribute.

Check farcry\core\packages\forms\farPagination.cfc for all available methods and attributes.

  • No labels