2amigos / yii2-selectize-widget

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

Passing functions in clientOptions #32

Closed tapaheh closed 7 years ago

tapaheh commented 7 years ago

Hi. Is it possible to pass functions in clientOptions, like render, createFilter and create in the Email Contacts Selectize example?

Edit: Answering my own question, the solution is to use yii\web\JsExpression, i.e.

'render' => [
  'item' => new JsExpression("
    function(item, escape) {
      return '<div>' +item.name+'</div>';
   }")
]
tonydspaniard commented 7 years ago

Great @tapaheh