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

Custom sort function #129

Open
stefangabos opened this issue Aug 3, 2017 · 1 comment
Open

Custom sort function #129

stefangabos opened this issue Aug 3, 2017 · 1 comment

Comments

@stefangabos
Copy link

It's not clear from the documentation how to use a callback function for the sort parameter.

Basically, I want the panel on the left to be sorted alphabetically while the one on the right to have keepRenderingSort. The callback function attached to sort gets a single parameter, the option itself (it would be great to also get the panel where it comes from) but returning true or false seem to have the same effect of not making the panels work as if they would have keepRenderingSort set to true.

So, in short, I want to prevent the sorting but only for the right panel. Is this possible?

Thanks!

@crlcu
Copy link
Owner

crlcu commented Sep 13, 2017

Hi @stefangabos,

Nope that's not possible, but I don't mind adding this feature, or maybe you would like to do it and create a pull request?

fralik added a commit to fralik/multiselect that referenced this issue Jun 28, 2018
… for left and right lists

* Instead of a single keepRenderingSort option there are now two new options: keepRenderingSortLeft and keepRenderingSortRight. They do exactly what the old option did, but independently for left and right.
* In addition, if keepRenderingSort* is set to true, there is an option to either skip initial sorting or not. The options are skipInitSortLeft and skipInitSortRight. Example, if keepRenderingSortLeft is true and skipInitSortLeft is false, then the custom sorting function will be applied to options before their rendering position is memorized.

Closes crlcu#129
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