Mottie / tablesorter

Github fork of Christian Bach's tablesorter plugin + awesomeness ~
https://mottie.github.io/tablesorter/docs/
2.6k stars 754 forks source link

Wierd sorting in "Dynamic checkbox sorting" + "stickyHeaders" widget #83

Open Rastishka opened 12 years ago

Rastishka commented 12 years ago

After adding "stickyHeaders" widget to your code http://jsfiddle.net/vCTHw/153/ sorting by 1st column works incorrect...

Mottie commented 12 years ago

Hmm, that is weird... I'll try to figure out why it's messing up. Thanks for reporting this issue!

Mottie commented 12 years ago

Found and fixed!

I've also created a new demo with a checkbox in the header that sets or clears all checkboxes.

Thanks for reporting this issue!

Rastishka commented 12 years ago

I've also created a new demo with a checkbox in the header that sets or clears all checkboxes.

yes, it works with static table, but if I update the table (by ajax or any other way) check box sorting stops working. It looks like that checkbox filters should be reinitialized??? demo

Mottie commented 12 years ago

Hi some0ne!

Just remove the hasCheckbox class from the table before updating (demo):

$("table").removeClass('hasCheckbox').trigger("update", [resort]); 
Rastishka commented 12 years ago

Wow, cool! It works!!!! Thank you very much!

It would be great if you add your example to documentation, I'm sure it will be usefull to many users!!!

Mottie commented 12 years ago

It's already been added to the wiki home page... there is also a link in the main documentation to more demos, including this one :)

Rastishka commented 12 years ago

And another bug report (small)! =)))

1) On stickyHeader clicking checkbox does not switch checkboxes inside tbody, but changes sort order. May be delegete events?

2) Are you sure that clicking checkbox should toggle ALL checkboxes in column? May be it should affect only VISIBLE rows (if using filter widget)?

Mottie commented 12 years ago

Alright, I'll look into this as well.

Mottie commented 12 years ago

Ok, I've updated the demo.

Basically, I made it so clicking in the header checkbox switches the checkbox setting in the body - I'm not sure I like this because the checkbox in the header doesn't mean anything anymore.

Clicking the header will still cause the table to sort, up or down, and there really isn't a way around this unless I completely remove the sorting from that column... maybe there is a better way, but I was too busy with other updates to really dig into the code.

thezoggy commented 12 years ago

feels odd having the checkbox just be a 'button'..

Mottie commented 12 years ago

I'm starting to think I should just make tablesorter automatically update any modified form elements so there won't be a need for an extra parser... but the core is getting so big now.

thezoggy commented 12 years ago

personally i would NOT want tablesorter to auto update.. it would cause performance issues.. plus ts shouldnt run a loop to check when something changes.. the user's function should initiate the update request..

Mottie commented 11 years ago

This is the updated dynamic checkbox demo I'm sticking with... the link on the wiki page has been updated as well.

Opps, leaving this open to add as an optional widget in version 3.

balamurugan32000 commented 10 years ago

when sticky header is visible, clicking on the "check all" checkbox does not select all child checkbox. ie., without scrolling, if we select the header checkbox it works, but after scrolling for say 1 or 2 time, stickly header becomes visible and clicking on it does not select/unselect all child

Mottie commented 10 years ago

Hi @balamurugan32000!

I've updated that demo... someday I'll make it look for the checkbox column instead of making you set an index.

balamurugan32000 commented 10 years ago

Thanks for the quick response. I have the same issue with other plugins like scroller, I will try to use the same solution to fix that issue.

Mottie commented 10 years ago

The scroller widget is a big mess... I am going to rewrite it instead of fixing all the bugs that have popped up.

balamurugan32000 commented 10 years ago

Thanks. Will watch for your update.