2amigos / yii2-selectize-widget

Selectize From Brian Reavis Yii2 Widget
Other
73 stars 41 forks source link

How to handle recent updates? #13

Closed stratigos closed 9 years ago

stratigos commented 9 years ago

Hi guys, and thanks again for this useful plugin. This morning I updated my Yii2 application via composer, and noticed the class Selectize was completely removed. I then assumed I should begin using the SelectizeTextInput class as its replacement, but it no longer has the 'url' property that was previously used to load data. Im having trouble finding documentation on porting this to a new version or to use a new property for the same functionality. Would you be able to provide any insight as to how I should port to the new classes from the old Selectize class?

What follows is my old code for using class Selectize to produce an input field for adding Tags to a Post, if this helps:

<?= Selectize::widget([
    'name'          => PostTag::getInputFieldName(),
    'value'         => $post_tags,
    'url'           => ['tag/list'],
    'options'       => [
        'class' => 'form-control',
        'id'    => 'post-tags-selected'
    ],
    'clientOptions' => [
        'delimiter'     => ',',
        'plugins'       => ['remove_button'],
        'valueField'    => 'name',
        'labelField'    => 'name',
        'searchField'   => ['name'],
        'loadThrottle'  => 500,
        'addPrecedence' => TRUE,
        'hideSelected'  => TRUE,
        'create'        => FALSE
    ],
]) ?>

And here is the error I recieve when using SelectizeTextInput:

Setting unknown property: dosamigos\selectize\SelectizeTextInput::url

creocoder commented 9 years ago

@Stratigos Hi, this option was renamed to loadUrl.

tonydspaniard commented 9 years ago

@Stratigos please, remember that if the new version doesn't fit your needs, you can always use previous version (even though we highly recommend you to use latest update)

stratigos commented 9 years ago

Thanks gentlemen, that fixed it for me.

@tonydspaniard I know, but I would like to stay up to date with whatever changes you guys suggest.