get rid of kartik select2

This commit is contained in:
resurtm
2016-12-21 13:34:44 +06:00
parent 2686a54aa3
commit f66689ef49
5 changed files with 266 additions and 59 deletions

View File

@ -9,16 +9,16 @@
* the LICENSE file that was distributed with this source code.
*/
use dosamigos\selectize\SelectizeDropDownList;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/**
* @var yii\web\View
* @var $model \Da\User\Model\Permission
* @var $this yii\web\View
* @var $model Da\User\Model\Permission
* @var $unassignedItems string[]
*/
use kartik\select2\Select2;
use yii\widgets\ActiveForm;
use yii\helpers\Html;
?>
<?php $form = ActiveForm::begin([
@ -32,8 +32,8 @@ use yii\helpers\Html;
<?= $form->field($model, 'rule') ?>
<?= $form->field($model, 'children')->widget(Select2::className(), [
'data' => $unassignedItems,
<?= $form->field($model, 'children')->widget(SelectizeDropDownList::class, [
'items' => $unassignedItems,
'options' => [
'id' => 'children',
'multiple' => true,

View File

@ -10,11 +10,12 @@
*/
/**
* @var yii\web\View
* @var $model \Da\User\Model\Role
* @var $this yii\web\View
* @var $model \Da\User\Model\Role
*/
use Da\User\Helper\AuthHelper;
use kartik\select2\Select2;
use dosamigos\selectize\SelectizeDropDownList;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
@ -34,16 +35,13 @@ $unassignedItems = Yii::$container->get(AuthHelper::class)->getUnassignedItems($
<?= $form->field($model, 'rule') ?>
<?= $form->field($model, 'children')->widget(
Select2::className(),
[
'data' => $unassignedItems,
'options' => [
'id' => 'children',
'multiple' => true,
],
]
) ?>
<?= $form->field($model, 'children')->widget(SelectizeDropDownList::class, [
'items' => $unassignedItems,
'options' => [
'id' => 'children',
'multiple' => true,
],
]) ?>
<?= Html::submitButton(Yii::t('user', 'Save'), ['class' => 'btn btn-success btn-block']) ?>

View File

@ -9,13 +9,14 @@
* the LICENSE file that was distributed with this source code.
*/
use kartik\select2\Select2;
use dosamigos\selectize\SelectizeDropDownList;
use yii\bootstrap\Alert;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/*
* @var $model \Da\User\Model\Assignment
/**
* @var $this yii\web\View
* @var $model Da\User\Model\Assignment
* @var $availableItems string[]
*/
@ -39,10 +40,10 @@ use yii\widgets\ActiveForm;
<?= Html::activeHiddenInput($model, 'user_id') ?>
<?= $form->field($model, 'items')->widget(Select2::className(), [
'data' => $availableItems,
<?= $form->field($model, 'items')->widget(SelectizeDropDownList::class, [
'items' => $availableItems,
'options' => [
'id' => 'items',
'id' => 'children',
'multiple' => true,
],
]) ?>
@ -50,4 +51,3 @@ use yii\widgets\ActiveForm;
<?= Html::submitButton(Yii::t('user', 'Update assignments'), ['class' => 'btn btn-success btn-block']) ?>
<?php ActiveForm::end() ?>