ajax, pagination, and re-ordering of result list
Posted: Mon Jul 10, 2006 7:11 am
Ok, kinda like what the title says; I've been reccomended by you guys in previous threads of mine to use ajax in order to re-order search results.
Since the results could be on multiple pages, I will have to query the database and select only eg. 10 results at a time.
WIth the title of my search results, when the user clicks on it, the database will be re-queried and re-ordered based on the data in the particular column of the search results.
EG. We have:
Title; Date; Cost
IF the user, clicks on title, the database will be re-queried using 'ORDER BY', and select the first 10 (or whatever) results. If 'Title' has already been selected and the results are in alphabetical order, I will reverse their order.
Up until this bit, I don't think I'll have too many dramas.
What I WANT to do is re-display only the search results table rather than refresh the entire page.
1.) IS it possible to modify the URL of the current page when I use the javascript to re-display the search results?
2 (and most importantly).) I really don't understand ajax that well....yep i've read all the tutorials on here and google etc etc. so i was wondering if someone could point me in the right direction as to how I would go about doing what i want to do???
With regard to the javascript component, do I use some command like onClick( ), requery the database, then re-create the html for the table displaying the search results or what???
My apologies about the vagueness here.
Since the results could be on multiple pages, I will have to query the database and select only eg. 10 results at a time.
WIth the title of my search results, when the user clicks on it, the database will be re-queried and re-ordered based on the data in the particular column of the search results.
EG. We have:
Title; Date; Cost
IF the user, clicks on title, the database will be re-queried using 'ORDER BY', and select the first 10 (or whatever) results. If 'Title' has already been selected and the results are in alphabetical order, I will reverse their order.
Up until this bit, I don't think I'll have too many dramas.
What I WANT to do is re-display only the search results table rather than refresh the entire page.
1.) IS it possible to modify the URL of the current page when I use the javascript to re-display the search results?
2 (and most importantly).) I really don't understand ajax that well....yep i've read all the tutorials on here and google etc etc. so i was wondering if someone could point me in the right direction as to how I would go about doing what i want to do???
With regard to the javascript component, do I use some command like onClick( ), requery the database, then re-create the html for the table displaying the search results or what???
My apologies about the vagueness here.