views:

265

answers:

5

Hi,

I am not sure the correct terminology for the process that I am trying to describe. I don't even know which platform is underlying the technique. If you understand my description, please give the link to the site(s) and or the keyword name of the process. I think it is done by AJAX, but I am not certain. I use php as the backend code, I just need to find a way to dynamically display the results. Please give suggestions. I forgot the name of the sites that use this, and my link history expired.

TIA

Description:

The page would have a search form and options. After the user submits, the search is initiated, and the results appear inside the dedicated result area. The page does not refresh, just the info inside the result area.

The display area will show 20 (or whatever) results (lines). There will be next, and previous buttons. If you hit next, the next set of results will display.

I am writing a code that generates 20 results for each display. There is no set number of results, so the results might have a start/first page, but do not have an end page.

Each time the user hits 'next', the program would generate/load new results. It would also store previous results, so that when a user hits 'prev', the previous results can instantly come up.

What techniques/program are theses?

A: 

It is not AJAX for sure.
Nobody uses AJAX for the pagination.

And there are about zillion pagination examples over internet

The only thing is never described in articles is how to persist search options for the other pages.
But it's simple enough: http_build_query() can help you

Col. Shrapnel
Hello, I'm Nobody :-)
Luc
@Luc a stupid one I assume. Ever heard of usability?
Col. Shrapnel
@Col. Shrapnel, sir, yessir, heard of it, even want it in my apps, but when a drill sergeant says jump, you don't ask how high. You jump and hope for the best. Hence my :-)On an unrelated note, how does one make a sour smile?
Luc
A: 

You need to have a GET/POST form submitted via AJAX which contains the fields in the search term and page number.

If you are going to set the page size to 20 results, page_num=4 will show results from 61-80 results.

Usually search results are GET instead of POST (Ex: See Google search results ) along with the page_number as another attribute and value.

Sairam Kunala
Thanks, but Google search will ask the server to 're-search' when you try to go back to the previous pages of results.
Jamex
A: 

Check this link out.

Babiker
Hi, I don't mean the live search.
Jamex
+1  A: 

Having recently handled pagination with Code Igniter (php framework), the following links might help you and anyone else out:

http://tympanus.net/jPaginate/

http://codeigniter.com/forums/viewthread/93045/

Usability is important and AJAX pagination introduces some important questions that need addressing regarding pagination, the following article will give some usability guidelines for displaying results in a table:

http://thedesignvanguard.com/crud-r-for-read

Code Igniter Prototype Framework Ajax Pagination:

http://codeigniter.com/wiki/AJAX_Pagination_with_CI_Pagination_Library/

Since we're using jQuery, we chose the following, Codeigniter jQuery framework for AJAX pagination

http://tohin.wordpress.com/2008/08/12/codeigniter-ajax-pagination/

http://tohin.wordpress.com/2008/10/07/codeigniter-ajax-pagination-exampleguideline/

Ivan Kruchkoff
Thanks for the links, I will check them out.
Jamex
A: 

@IVAN .. good to know that the library came helpful..

About that searching option; check the recent commit in github http://github.com/neotohin/CodeIgniter-Ajax-pagination-Library there is an additional parameter added for searching.

I think the simple code in readme is enough for understanding the mechanism.

neotohin