The Dopefly Tech Blog

<< The Dopefly Tech Blog Main page

Pagination.cfc - 1.0 RC Release

posted under category: Free Code For You on January 6, 2008 at 1:00 am by MrNate

Today I am releasing a 1.0 Release Candidate of my Pagination.cfc. New in this version is:

Added examples (lots, in the download)
Added documentation (featuring what, why, usage, reference, css and extensibility)
Added ability to paginate Arrays and Structures
Added properties: BeforeNumericLinksHTML, BeforeNextLinkHTML, ClassName, TotalNumberOfItems, FirstPageLink, PreviousPageLink, NextPageLink, LastPageLink
Added CFCUnit test (needs help)
Moved numbered link rendering into its own function (extensibility)
Fixed CSS support (and documented)

I'm not anticipating further changes, so this is a release candidate! If you can, please help me test it out. I did include a CFCUnit test file but I didn't get very far with it. Any feedback is highly appreciated.

Download Pagination 1.0 RC here.

View the documentation online here. It is included in PDF and HTML formats in the download.

I think I'll put this up on RIAForge for the 1.0 final. Comments appreciated!

Too old to comment!
On Feb 14, 2008 at 1:00 AM rdillman (rdillman@example.com who would have preferred an address at gmail.com) said:
Great work on this so far!

One thing I'd like to suggest is to set a link limit. A decision for weather to show next last first previous. If you only have 5 pages the extra links are redundant.

so IF ShowNumericLinks is 'True' AND TotalNumberOfPages GT NumericDistanceFromCurrentPageVisible
setShowFirstLastDisabledHTML(True)
setShowFirstLastHTML(True)
setShowPrevNextDisabledHTML(True)
setShowPrevNextHTML(true)

Just not sure how to get there. Any thoughts?

On Apr 7, 2008 at 1:00 AM Felipe Serrano (redpill via xerrano.com) said:
I, using your pagination for some time now... Thanks!

Today I started on a new project where I' using CF8 new tags like CFDIV
where I place dynamic content without refreshig the page using javascript:ColdFusion.navigate or AjaxLink.
At first I though to my self that using -- getBaseLink() - getUrlPageIndicator() - getCurrentPage() -- will work just the same way, but I did't succeed.

Is ther a way to acomplish this or your CFC should need extra work?


Thanks again.

On Apr 17, 2008 at 1:00 AM Nathan Strutz (http://www.dopefly.com/) said:
Felipe,
I've been thinking about this for a while - I beileve pagination.cfc could do your job, but it will require some work on your part. Pagination.cfc currently only really works for traditional, page-refreshing links. You would have to override or otherwise change the functionality of the library to accomplish what you need. Most importantly, changing the links to javascript calls that will pull down the next page of your ajax table. I haven't messed around with the CF8 stuff enough to figure it out for you, but if you come up with an elegant solution, one that perhaps extends my Pagination.cfc, please share it with me and the community, if you can. I'd love to incorporate it somehow.

On Nov 23, 2009 at 1:00 AM Scott Stewart (webmaster whose email lies with sstwebworks.com) said:
Nathan, Felipe I did get this working with JQuery using a small piece of additional code..

$("div#deactivate_sku a").live("click", function(){
var href=$(this).attr("href");
$("#content-box").load(href);
return false;
});

-----------------------------------


'div#deactivate_sku a' references the a tags inside a div that contains output from 'getRenderedHTML()'. It then "hijacks" the href from those a tags.
<p>
'#content-box' references the div that content is being loaded into it then uses the load command to render the value of 'href'
Too old to comment!