javve / list.js

The perfect library for adding search, sort, filters and flexibility to tables, lists and various HTML elements. Built to be invisible and work on existing HTML.
https://listjs.com
MIT License
11.2k stars 896 forks source link

Can't sort desc when using pagination #184

Open nguyen-brian opened 10 years ago

nguyen-brian commented 10 years ago

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.

sunaj commented 10 years ago

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.

javve commented 10 years ago

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!

sunaj commented 10 years ago

Sounds good, enjoy your vacation!

On Sat, Dec 21, 2013 at 11:18 AM, Jonny Strömberg notifications@github.comwrote:

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 .

seb-vial commented 10 years ago

Any news on that issue ?

ccario83 commented 10 years ago

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

javve commented 10 years ago

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 commented 10 years ago

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

ccario83 commented 10 years ago

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.

sunaj commented 10 years ago

@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 notifications@github.com 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 .

timracer commented 10 years ago

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!

Tumas commented 10 years ago

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

helenatxu commented 10 years ago

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?

daleamann commented 9 years ago

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.

alexcroox commented 9 years ago

Same here sort doesn't work with the pagination plugin

yashilanka commented 8 years ago

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

tarekbazine commented 5 years ago

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