Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sortInitialOrder reset #30

Closed
severa opened this issue Feb 26, 2012 · 12 comments
Closed

sortInitialOrder reset #30

severa opened this issue Feb 26, 2012 · 12 comments

Comments

@severa
Copy link

severa commented Feb 26, 2012

Hi. Nice tool. One thing that might be helpful would be to enable the ability to reset sortInitialOrder for a column if a different column is selected for sorting. In other words, if I select column 0 (which sorts by its sortInitialOrder) then I select column 1 (which sorts by its sortInitialOrder) but then I select column 0 again, it will sort by !sortInitialOrder. This does not feel natural when moving between columns, imho. I believe in order to achieve this the default sort state would need to be 'reset' for any column that is 'selected away from' (or brute-forcely, all columns that are not selected). I guess ideally it would be possible to have a property to allow the coder to specify whether s/he wants that column's sortInitialOrder reset when selecting other columns. thoughts?

@Mottie
Copy link
Owner

Mottie commented Feb 26, 2012

Hi Severa!

Hmm, that sounds like a good idea! I'll add it to my to do list :)

@Mottie
Copy link
Owner

Mottie commented Feb 27, 2012

Ok!

I've added a new option named sortRestart (since sortReset was already used) which seems to work as you expect; but it might do a little something odd when you click on a column after multi-column sorting. Here is how to duplicate the wierdness (if it really is that bad):

  • Sort the first column (now in sortInitialOrder)
  • Next, shift sort the second twice (so it's in !sortInitialOrder
  • Lastly, click (no shift) on the second column. It will sort in the !sortInitialOrder direction...

It doesn't seem that bad, but I wanted to see what you thought,

@severa
Copy link
Author

severa commented Feb 27, 2012

Hi Mottie. Interesting, I am using 'desc' sortInitialOrder and this change seems to cause that setting to be ignored. So while it now does restart from sortInitialOrder each time you switch back to a column, it only works for 'asc' sort order (in fact, that setting seems hard-coded now). Was that intentional? I also noticed that the value does not seem to be able to be applied via a header (ie to override for a specific column). Was that also intentional?
I agree that the shift sort option introduces a tricky situation (actually that is the same behavior as before the change so maybe the caveat can be that sortInitialOrder does not apply to multi-column scenarios? :-) ).

@Mottie
Copy link
Owner

Mottie commented Feb 27, 2012

Hmm, it's a bit more complicated than I thought... give me some time to work on a fix :P

@severa
Copy link
Author

severa commented Feb 27, 2012

:-) Yes, I thought it might be. Sorry about that. But I do think its a useful feature. One scenario where I think its particularly helpful is when you have table that consist of similar statistics over multiple time periods (eg test score results for different years). A common use-case in that situation is to want to know who was the top performer in a single year, then the top performer in another year. Or the lowest performer, or top 5 performers, etc. With that kind of homogenous data, it is beneficial to be able to easily make such comparisons by column with only a single click. Thanks!

@Mottie
Copy link
Owner

Mottie commented Mar 2, 2012

Just letting you know that I'm still trying to fix this bug. If I can't get it by this weekend, I'll save it for the next update.

@Mottie
Copy link
Owner

Mottie commented Mar 7, 2012

Grrr, I didn't get this fix included in version 2.1... but I'll keep working on it. Sorry!

@severa
Copy link
Author

severa commented Mar 7, 2012

Ok, sorry for the frustration. :-)

@Mottie
Copy link
Owner

Mottie commented Mar 8, 2012

Okie dokie, I think I finally got it fixed! YAY!!

Check out the new demo in version 2.1.1.

@Mottie
Copy link
Owner

Mottie commented Mar 17, 2012

Well, I guess it's working? I'm going to go ahead and close this issue. If you find any problems with the updates, please feel free to reopen this issue. Thanks!

@Mottie Mottie closed this as completed Mar 17, 2012
@severa
Copy link
Author

severa commented Mar 17, 2012

Sorry, I haven't had a chance to test it thoroughly. I will try over the weekend. Thanks!

#end

On Mar 16, 2012, at 9:22 PM, Rob Greply@reply.github.com wrote:

Well, I guess it's working? I'm going to go ahead and close this issue. If you find any problems with the updates, please feel free to reopen this issue. Thanks!


Reply to this email directly or view it on GitHub:
#30 (comment)

@severa
Copy link
Author

severa commented Mar 26, 2012

Hi Mottie. Thanks a lot for this, this is perfect! Sorry for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants