multiselect
                                
                                 multiselect copied to clipboard
                                
                                    multiselect copied to clipboard
                            
                            
                            
                        Limit selected options
How I can limit the select options, either the Right side or Left side?
Hi, I think you can achieve this by using the beforeMoveRight / beforeMoveLeft callbacks.
Sent from my iPhone
On 27 Jul 2021, at 12:55, Hossam Abdelmajeed @.***> wrote:
 How I can limit the select options, either the Right side or Left side?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
may I ask for an example (full example), as I didn't found anything but a description in the documentation? much appreciated
a very simple code didn't work:
beforeMoveToRight: function($left, $right, $options) { alert($options); return true; },
any suggestions?
I needed to limit the amount of options being move to the $left column. This worked for me:
beforeMoveToLeft: function($left, $right, $options) { if($left.children('option').length >= 2) { return false; } else { return true; }; }
Also $options is an object. Putting it in an alert will only tell you [Object object].
console.log($options); will show you what's in the object.
Hope it helps.