list.js icon indicating copy to clipboard operation
list.js copied to clipboard

Can't sort desc when using pagination

Open nguyen-brian opened this issue 10 years ago • 16 comments

I'm using 1.0, and my table has pagination. I set up sort on one of my column headers, and it works when I click the column the first time. The second time I click on the header, it does not switch to "desc" sort but rather it stays sorted "asc".

After some investigation I found that the click handler that invokes sorting is being bound twice -- once for my initial List instantiation and once when the Pagination plugin instantiates a List. As a result, the click handler actually fires twice every time I click on the column header, and the "asc" sort keeps overriding the "desc" sort.

Not sure if this issue belongs on the Pagination project or this project, but I'm happy to copy this over to the other project if that's more appropriate.

nguyen-brian avatar Dec 06 '13 01:12 nguyen-brian

I'm seeing this problem as well - a fix would be greatly appreciated. Also I see that the Sort functionality is part broken (try sorting on "Description") on: http://sindresorhus.com/bower-components/ - presumably same issue.

sunaj avatar Dec 20 '13 12:12 sunaj

It seems like there is some general problems with the sorting, I'll fix it as soon as I get back from my computer-less-vacation!

javve avatar Dec 21 '13 11:12 javve

Sounds good, enjoy your vacation!

On Sat, Dec 21, 2013 at 11:18 AM, Jonny Strömberg [email protected]:

It seems like there is some general problems with the sorting, I'll fix it as soon as I get back from my computer-less-vacation!

— Reply to this email directly or view it on GitHubhttps://github.com/javve/list.js/issues/184#issuecomment-31061355 .

sunaj avatar Dec 21 '13 12:12 sunaj

Any news on that issue ?

seb-vial avatar Jan 13 '14 10:01 seb-vial

Also having this issue. Really like the library, though!

ccario83 avatar Jan 30 '14 23:01 ccario83

This should be fixed now! Download v1.1.0.

Sorry for the delay. I found some more fishy stuff associated with the sort/pagination.

javve avatar Feb 03 '14 21:02 javve

Oh, remember to visit the changelog -> http://listjs.com/overview/changelog

javve avatar Feb 03 '14 21:02 javve

Still seem to be having this issue (sort only works once when also using pagination):

http://jsfiddle.net/zpBZY/

Sorry if I'm doing something obviously wrong.

ccario83 avatar Mar 03 '14 21:03 ccario83

@lucidv01d, don't think you're doing anything wrong. I ended up building custom clean solution and removing listjs from my project. Epiphany came after I realized that server-side sort and search is the only viable long term solution for the data load I'll be dealing with in my app (it is very easy to underestimate this, see the how many of the listjs examples are already lagging badly from doing too much frontend rendering)

On Mon, Mar 3, 2014 at 9:38 PM, lucidv01d [email protected] wrote:

Still seem to be having this issue (sort only works once when also using pagination):

http://jsfiddle.net/zpBZY/

Sorry if I'm doing something obviously wrong.

Reply to this email directly or view it on GitHubhttps://github.com/javve/list.js/issues/184#issuecomment-36563042 .

sunaj avatar Mar 04 '14 14:03 sunaj

Hi, I'm a newbie in js, I want to use Listjs but with pagination, and I can't connect my own pagination... Could you help me please. I'm glad to use your pagination, but it's without css styles, without "go to first", "prev", "active", "next", "go to last" links. Can you add it to your pagination and highlight active page number via css styles? Or tell me how can I connect this (https://github.com/wesnolte/Pajinate/wiki) pagination via "plugin [ ]" or etc. I'm interest in "Style First/Next and Last/Next" named pagination on this demo page (http://dl.dropboxusercontent.com/u/4151695/html/pajinate/examples/example1.html) Thank you!

timracer avatar May 20 '14 03:05 timracer

Issue still exists. I'm using list.js version 1.1.1, list.pagination.js 0.1.1

Tumas avatar May 30 '14 13:05 Tumas

Hi! This issue shouldn't be closed because is not solved. I'm using list.js version 1.1.1, list.pagination.js 0.1.1 too. Could you please solve it ASAP?

helenatxu avatar Aug 19 '14 09:08 helenatxu

Same issue here as well, pagination isn't working with sorting so I am using a different pagination, but that one isn't working with the sorting either.

daleamann avatar Feb 03 '15 15:02 daleamann

Same here sort doesn't work with the pagination plugin

alexcroox avatar Sep 21 '15 08:09 alexcroox

me too not working.. list.js 1.1.1 and pagination 0.1.1

yashilanka avatar Dec 16 '15 17:12 yashilanka

plz check this issue i think it's related to this

tarekbazine avatar Nov 11 '18 19:11 tarekbazine