You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
@brianreavis, could you please give an example how to implement your advice?
I need to sort optgroups by its labels, is it possible?
In my "options" code for selectize there is a key sortField with a value of "text". But it sorts only options by its inner text.
And I need to sort not only options inside optgroup, but also optgroups themselves.
@brianreavis thanks for the great package. I am using 0.12.1_5
can't seem to get it to pick up the $order, I have optgroups: [{$order: 1, group:'role',name:'Role'}, {$order: 2,group:'team',name:'Team'}, {$order: 3,group:'people',name: 'Participants'}]
but it renders in the wrong order. I tried changing the numbering, in reverse... no luck I see items in this order Participants, Team, People regardless of the $order param/val
@adamgins had the same issue. Saw the optgroup examples from selectize, where the added the 'lockOptgroupOrder' flag. Seems to fix it. I'm using 0.12.1.
Just add 'lockOptgroupOrder: true' to your selectize options on initialize.
Activity
NotSqrt commentedon Jul 30, 2014
There's an option called ''optgroupOrder'' for this.
Refactored $order prop to be added by addOption, addOptionGroup (closes
brianreavis commentedon Jan 30, 2015
This has changed a little in 0.12.0. Now, set the
$orderproperty on each item in youroptgroupsarray.shurfee commentedon Dec 12, 2016
@brianreavis, could you please give an example how to implement your advice?
I need to sort optgroups by its labels, is it possible?
In my "options" code for selectize there is a key sortField with a value of "text". But it sorts only options by its inner text.
And I need to sort not only options inside optgroup, but also optgroups themselves.
<optgroup label="1"> <option>Text ABC</option> </optgroup><optgroup label="2"> <option>Text BCD</option> </optgroup>adamgins commentedon Aug 10, 2017
@brianreavis thanks for the great package. I am using
0.12.1_5can't seem to get it to pick up the
$order, I haveoptgroups: [{$order: 1, group:'role',name:'Role'}, {$order: 2,group:'team',name:'Team'}, {$order: 3,group:'people',name: 'Participants'}]but it renders in the wrong order. I tried changing the numbering, in reverse... no luck I see items in this order Participants, Team, People regardless of the
$orderparam/valupdate: I upgraded to
0.12.4, same issuebrjadams commentedon Dec 22, 2017
@adamgins had the same issue. Saw the optgroup examples from selectize, where the added the 'lockOptgroupOrder' flag. Seems to fix it. I'm using 0.12.1.
Just add 'lockOptgroupOrder: true' to your selectize options on initialize.