User1988
User1988

Reputation: 1997

Trouble Re-order a HTML table when the user clicks on the table header

I am trying to re-order a HTML table when the user clicks on the table header. Here is all I can do, but still doesn't work. i want to do sorting By default it will come as event_date desc. enter image description here

it works properly

Now when i click on event name then its should do sorting as event_name desc and when i again click on event name then its should be event_name asc.

How to do this? please help me as soon as possible...

Thanks in advance...

Upvotes: 0

Views: 110

Answers (2)

Subash
Subash

Reputation: 3168

you could use jQgrid

It is much easier to manage tables using jquery

Upvotes: 1

Sid
Sid

Reputation: 560

If you are doing it using javascript then its better to use any external js like datatable.
Or if are using php you can append parameter (asc/desc) to Event Title link and according to that sort the result.
Plz show wht you have done to find appropriate solution.

Upvotes: 0

Related Questions