yii2mod / yii2-selectize

selectize.js wrapper for yii2.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

confusing of jquery-ui

lichunqiang opened this issue · comments

I'm confusing of the depends on jquery-ui. Is there any usage about it?
It is can be removed?

Thanks.

Hi, thanks for issue. Jquery-ui asset needed for selectize plugins, for example drag_drop
For example:

<?php

$values = ['test', 'test2'];

echo \yii2mod\selectize\Selectize::widget([
    'name' => 'tag-selectize',
    'options' => [
        'data-data' => $values ? \yii\helpers\Json::encode($values) : null // Set default values
    ],
    'pluginOptions' => [
        // define list of plugins
        'plugins' => ['drag_drop', 'remove_button'],
        'persist' => false,
        'createOnBlur' => true,
        'create' => true
    ]
]);
?>

Without jquery-ui dependency this widget doesn't be displayed.

Thanks for your reply.

But If the user does not use the dnd feature, I think it should be not loaded.

Can you create PR for this feature?

My pleasure.