Welcome Guest, Not a member yet? Register   Sign In
How to Pagination and Order By
#1

[eluser]saidbakr[/eluser]
Hello,

The pagination object of CI is wonderful and easy way to generate pagination. However, I'd like to achieve pagination that it able to serve order by in the generated query.

For example about what I exactly need is found in the following Link. The regarded page is a list for all registered users on the website. By the way, the application of the regarded website is developed by me.

I need some ideas about achieving this goal using Pagination class.
#2

[eluser]OES[/eluser]
Unless I,m getting your question wrong the pagination will only display by the order you set in your query.

So if you want to add it in order of column selected use flashdata or add an additional segment to your url.

I have done it even with Ajax with order by column so it can be done :-).

Hope this helps
#3

[eluser]saidbakr[/eluser]
I think that the idea of adding new segment is better for me. However, the idea I focused on it in the regraded example is keeping the current page while changing the order. This will require dynamic change of the $conf['base_url'] of the pagination class.

I will try and tell you what could I get later.




Theme © iAndrew 2016 - Forum software by © MyBB