I just made the example work, but what I see, is that all the records to show are pulled from the server on one single request only. It is posible to make a new request each time a page, prev or next link is clicked, pulling only a small set of records each time?
I think it should be possible although I haven't made any attempt of doing it, so don't take me for granted.
I personally prefer making less requests to the server and also there is the need to run a query on all records anyway in order to get total rows, etc...
You may want to try limiting the query first and then attach listeners for NEXT and PREV to get other records and updating the DOM accordingly, but still you will need also listeners for each page number and so on. It might be more complicated this way.
Good luck and let me know if you have managed to do it.
Hi Carlo, Can you place the code onto github? would like to fork & improve. Would like as Andrew said to add some smart caching (preload 1 page item in advance), use getJSON and to add json instead search&replace html code.
The problem. The script creates a memory of the results, and pulls each page from the memory divs without resaving any changes to the pages before change. So I had to figure out a way to see what the current page is during a page change, and then apply changes to the original "memory" pages.
It was tricky getting the id of the current page, if this was a variable included in the class then it would be cleaner (good update idea).
If you are in a similar situation and would like to look at my code please email me at adistantbox at gmail.com .
My name is Carlo Tasca and I work as a programmer at brandammo.co.uk.
For more than 10 years I have been working in programming roles in Italy (where I was born in 1971) and United Kingdom. Having gained qualifications in fields such as Industrial Electronics, Website Development and Programming, I am now taking responsibility for all technical online development at BRANDAMMO where I continue to develop my skills in areas of programming in line with new and emerging technologies.
Hi !
ReplyDeleteI just made the example work, but what I see, is that all the records to show are pulled from the server on one single request only. It is posible to make a new request each time a page, prev or next link is clicked, pulling only a small set of records each time?
Hi Andrew,
ReplyDeleteI think it should be possible although I haven't made any attempt of doing it, so don't take me for granted.
I personally prefer making less requests to the server and also there is the need to run a query on all records anyway in order to get total rows, etc...
You may want to try limiting the query first and then attach listeners for NEXT and PREV to get other records and updating the DOM accordingly, but still you will need also listeners for each page number and so on. It might be more complicated this way.
Good luck and let me know if you have managed to do it.
Cheers
hi
ReplyDeletecan i get a copy of the php file
http://www.myjquery.co.uk/paginators_data/demo_news_data.php
because i am getting some problems...
please help...
@kk
ReplyDeleteSure...What sort of problems do u have?
Hi Carlo,
ReplyDeleteCan you place the code onto github? would like to fork & improve. Would like as Andrew said to add some smart caching (preload 1 page item in advance), use getJSON and to add json instead search&replace html code.
Hello Marius,
ReplyDeleteSure, no problem... Give me a few days though. Need to find the time.
I will post here when I have set up an account at github.
Thank you for this wonderful tool! How do I get the callback function to work?
ReplyDeleteUsing the example I could not get paginator working, but moving the script to the bottom of my page, everything is working fine.
ReplyDeleteNice plugin but bad tutorial, can you zip full example with all files (including .php) that will help alot. Thanks
ReplyDeleteHello I have an issue with forms in the pages, as I go to next page the form always resets.Can I get around this?
ReplyDeletesolved it with a hack.
ReplyDeleteThe problem. The script creates a memory of the results, and pulls each page from the memory divs without resaving any changes to the pages before change. So I had to figure out a way to see what the current page is during a page change, and then apply changes to the original "memory" pages.
It was tricky getting the id of the current page, if this was a variable included in the class then it would be cleaner (good update idea).
If you are in a similar situation and would like to look at my code please email me at adistantbox at gmail.com .