An Issue with Karthiks Select 2 widget

[color=#222222][size=2]i have an issue with Karthiks Select 2 widget , when i choose lets say 3 lists, its reorder them randomly , how i can control ordering the items ?[/size][/color]

[color=#222222][size=2]this is my code[/size][/color]


<?php echo Select2::widget([

						'attribute' => 'country_id',

						'value' => '',

						'model' => $model,

						'data' =>ArrayHelper::map(Countries::find()->all(), 'id', 'name'),

						'options' => ['multiple' => true, 'placeholder' => '']




They are ordered in the order they were inserted into your db by default. You need to order your query. The second way allows you to sort by multiple columns and change the order.






ok thanks