2amigos / yii2-multi-select-widget

Bootstrap MultiSelect and MultiSelect Listbox widgets for Yii2
https://2amigos.us
Other
45 stars 29 forks source link

better documentation #1

Closed andresbott closed 9 years ago

andresbott commented 10 years ago

Hi, please make a litte better documentation i had to dig into the code.

please add some examples like this:

echo MultiSelect::widget([ 'id'=>"multiXX", "options"=>['multiple'=>"multiple"], // for the actual multiselect 'data' => [0=>'super', 2=>'natural'], // data as array 'name' => 'multti', // name for the form "clientOptions"=>["includeSelectAllOption"=>true,'numberDisplayed'=>2], // js options ]);

also refear that if a model is provided, the model is used; i asume with option "model"=>$model (did not try it)

andresbott commented 10 years ago

also refer the attribude "value"=>[0,2], as the preselected values

tonydspaniard commented 10 years ago

@odosuiadan Thanks for suggestion. We are truly busy and any help regarding documentation (pull requests) would be more than welcomed.

In our plans we want to build a website to provide full documentation on every one of the extensions that we share to the community but, as said, truly busy...

xenogenesi commented 7 years ago

To get the value working and get pre-selected items I had to put it into options

"options" => ['multiple'=>"multiple",  "value"=>[0,2] ]
shokhaa commented 5 years ago

how to multiple selected many object? actionUpdate $cat = Category::find()->all();

    $categoryEmploye = CategoryEmploye::find()->where(['employe_id' => $model->id])->all();

view $catArray = \yii\helpers\ArrayHelper::map($cat, 'id', 'title');

<?= $form->field($categoryEmploye, 'category_id')->widget(\dosamigos\multiselect\MultiSelect::className(),[ 'data' => [$catArray], "options" => ['multiple'=>"multiple"], 'clientOptions' => [ 'multiple' => true, ] ]) ?>