On documentations says:
echo Select2::widget([
'name' => 'color_2',
'value' => ['red', 'green'], // initial value
'data' => $data,
'maintainOrder' => true,
'options' => ['placeholder' => 'Select a color ...', 'multiple' => true],
'pluginOptions' => [
'tags' => true,
'maximumInputLength' => 10
],
]);
But if i set the opposite ['green','red',] on select2 view show firt red and after green(ordered by name). Not maintain order
On documentations says: echo Select2::widget([ 'name' => 'color_2', 'value' => ['red', 'green'], // initial value 'data' => $data, 'maintainOrder' => true, 'options' => ['placeholder' => 'Select a color ...', 'multiple' => true], 'pluginOptions' => [ 'tags' => true, 'maximumInputLength' => 10 ], ]); But if i set the opposite ['green','red',] on select2 view show firt red and after green(ordered by name). Not maintain order