Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 11 Jun 2015, 20:12
Mickie D Mickie D is offline
 
Join Date: Jun 2002
pagination and drop down session

I have successfully setup pagination for my new modification, which gets the information from the database then limits the results to 10 items per page.

The only trouble is that I would now like to sort the items by different values, but I am not sure how sessions work in the respect do I need to add a column to the MySQL database or just setup a session variable?

This is my code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Code for the dropdown

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This works great for page one of the pagination but because the pagination changes pages it just defaults the switch on any other page

file_fullsize

I guess that i need to store the drop down orderby variable across the pagination?

Thank you for any help
Mick
__________________
Digitalworldz Satellite Cable TV Forums
Cable, Satellite, Consoles, Mobile Phones, Audio Visual, and general chat
Reply With Quote
  #2  
Old 12 Jun 2015, 07:28
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Real name: Sven
You need to add your sort value to the pagination url parameters, then retrieve it (using get, not post in the input cleaner).

Don't forget to set your dropdown to the chosen value.
__________________
Please note that there will be no further updates to my addons, especially they will not be upgraded for vB5. I'm leaving vB, since IB choose to go the banana-way yet again.

http://www.roma-antiqua.de
Reply With Quote
  #3  
Old 12 Jun 2015, 07:46
Mickie D Mickie D is offline
 
Join Date: Jun 2002
Originally Posted by cellarius View Post
You need to add your sort value to the pagination url parameters, then retrieve it (using get, not post in the input cleaner).

Don't forget to set your dropdown to the chosen value.
Thank you very much for you help.

I used the guide on here to setup the pagination,


This code is used in the pagination, to be honest, I did not take much notice of it just that it worked... But is this where I need to append the GET of the orderby value?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Thank you again, much appreciated

Mick

--------------- Added 12 Jun 2015 at 08:48 ---------------

Cellerus you are a Legend, it was so easy when you think about it!!!

For anyone looking for the same issue I did as said above changed everything to GET (not POST). then just added in the orderby into the pagination construct


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Digitalworldz Satellite Cable TV Forums
Cable, Satellite, Consoles, Mobile Phones, Audio Visual, and general chat

Last edited by Mickie D; 12 Jun 2015 at 09:20.
Reply With Quote
  #4  
Old 12 Jun 2015, 08:58
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Real name: Sven
Glad you got it sorted (pun fully intended)
__________________
Please note that there will be no further updates to my addons, especially they will not be upgraded for vB5. I'm leaving vB, since IB choose to go the banana-way yet again.

http://www.roma-antiqua.de
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 01:29.

Layout Options | Width: Wide Color: