1

I have already added data using select2 yiibooster widget but how i can update data using select2 widget. how i show already added records in yiibooster select2 widget

 <?php
    echo $form->labelEx($model, 'measurement');

    $this->widget(
            'bootstrap.widgets.TbSelect2', array(
        'name' => 'measures[]',
        'data' => Ingredient::getmeasurementhere(),
        'htmlOptions' => array(
            'multiple' => 'multiple',
            'class' => 'span3',
            'id' => 'select1li_id'
        ),
        //'events' => array('change' => 'js:getsubcategories')
            )
    );
    ?>

i am getting data using Ingredient::getmeasurementhere() function how i fetch this using update or write new function but how to show in select2 ? Thanks in advance

FahadAkram
  • 445
  • 1
  • 5
  • 25
  • **data** expects an object but like **val** it still needs array of `id`, `text` and `locked` for each. Is that what is being given? docs: http://ivaynberg.github.io/select2/ – arikin Jun 19 '14 at 09:45

0 Answers0