Jump to content

Wondering: Pagination for Pireps List


selwynorren

Recommended Posts

Thanks Jeff, just for interest, is it not possible to write a piece of code that will count the amount of records in one central location, then its just a call from any page we would like that will paginate any list. So maybe write the record count in one of the class file maybe? and then just call the function on the template page?

Is that even possible?

Link to comment
Share on other sites

Guest lorathon

I am actually trying to use a jquery tablesorter. It is working but it seems that I am having a problem with the skin. I know zero about skinning and css stuff. The page form at the bottom is not starting in the correct position. I am sure it has to do with the <div> put as I know jack diddley about that I am stuck.

Here is the link to the tablesorter. It is actually quite easy to implement.

http://tablesorter.com/docs/

Add the following the the head

       <script type="text/javascript" src="<?php echo fileurl('lib/js/jquery-1.3.1.min.js');?>"></script> 
<script type="text/javascript" src="<?php echo fileurl('lib/js/jquery.tablesorter.js');?>"></script> 
<script type="text/javascript" src="<?php echo fileurl('lib/js/jquery.tablesorter.pager.js');?>"></script> 

Put these files in the lib/js folder on your site

jquery-1.3.1.min.js
jquery.tablesorter.js
jquery.tablesorter.pager.js

Then follow the instructions. Here is a quick guide for implementation

http://www.novell.com/communities/node/8797/jquery-tablesorter-pagination-and-sorting-made-simple

Link to comment
Share on other sites

Guest lorathon

Here is my problem

post-451-055105700 1278601946_thumb.jpg

If I click the change page or select a different count it displays fine after that. Here is the pager form code. These are the only <div> in the entire template. Could that be the problem? Can the pager be stuck into something else beside the <div>? I tried changing the <div> to <table> and it would display correctly but would not control the table.

Any help would be greatly appreciated.

<div id="pager" class="pager">
<form>
	<img src="<?php echo fileurl('lib/images/first.png');?>" class="first"/>
	<img src="<?php echo fileurl('lib/images/prev.png');?>" class="prev"/>
	<input type="text" class="pagedisplay"/>
	<img src="<?php echo fileurl('lib/images/next.png');?>" class="next"/>
	<img src="<?php echo fileurl('lib/images/last.png');?>" class="last"/>
	<select class="pagesize">
		<option value="10">10 per page</option>			
		<option value="20">20 per page</option>
		<option value="50">50 per page</option>	
		<option value="100">100 per page</option>
	</select>
</form>
</div>

Link to comment
Share on other sites

ok Looks like i have it working perfectly,

What I really like about this is that its very very easy to apply to any table anywhere in phpVMS.

The file jquery.tablesorter.pager.js needs a slight change in line 22: change "absolute" to "static" I also right aligned the div tag to make it look better (imo)

For some reason the option called "Limit" does not work for me, so I just commented it out and swapped the order around

you can view the sample here: http://www.orrencharters.co.za/index.php/profile/view/1

Jeff you are brilliant, thanks so much for this one!!

Link to comment
Share on other sites

Guest lorathon

I had the same issue.

I resolved here

http://forum.phpvms.net/topic/3271-no-route-passed/

Look for my posts.

It had to do with the library (at least mine did) I had too calls to it. One in the core_htmlhead.tpl and then I put one in the header.tpl in my skin folder. Once I got rid of the second call in the header it worked just fine and have not had any other issues at all.

Link to comment
Share on other sites

  • Moderators

Wow how easy was that :-)

Just need to sort out that last bit of no route passed. just commented out <script type="text/javascript" src="<?php echo fileurl('lib/js/jquery-1.3.1.min.js');?>"></script> and all works fine... whooooo:)

Are there any other known problems using this?

Link to comment
Share on other sites

I have had no hiccups at all so far. I have even implemented this pagination on a few other pages of mine and it works beautifully. Only reported issue I have had has been regarding the lib/js/jquery-1.3.1.min.js, but as you mentioned its been resolved.

Next I want to try Nabeel's implementation that he has used in the Admin side, just no had the time yet

Link to comment
Share on other sites

  • Moderators

I have had no hiccups at all so far. I have even implemented this pagination on a few other pages of mine and it works beautifully. Only reported issue I have had has been regarding the lib/js/jquery-1.3.1.min.js, but as you mentioned its been resolved.

Next I want to try Nabeel's implementation that he has used in the Admin side, just no had the time yet

Orren, i'm going to try Nabeel's way. I'll let you guys know how it went.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...