Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

How to passing own 'option_create'? #33

Open
pitonn opened this issue May 21, 2017 · 2 comments
Open

How to passing own 'option_create'? #33

pitonn opened this issue May 21, 2017 · 2 comments
Labels

Comments

@pitonn
Copy link

pitonn commented May 21, 2017

Hi, how to pass own 'option_create'? Or how to change lang for option 'Add'? Thanks.

@msvmiode
Copy link

msvmiode commented Jun 2, 2017

 <?= $form->field($topicForm, 'tagNames')->widget(SelectizeTextInput::className(), [
        'loadUrl' => ['tags'],
        'options' => ['class' => 'form-control'],
        'clientOptions' => [
            'plugins' => ['remove_button'],
            'valueField' => 'name',
            'labelField' => 'name',
            'searchField' => ['name'],
            'create' => true,
            'render' => [
                'option_create' => new JsExpression("function (data, escape) {
                    return '<div class=\"create\">BlahBlahBlah <strong>' + escape(data.input) + '</strong>&hellip;</div>';}"
                ),
            ],
        ],
    ])->error(false) ?>

It works for me

@tonydspaniard
Copy link
Member

Perfect @msvmiode ! Thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants