Yii Framework Forum: Yiiwheels -> Whselect2 -> Plaseholder Isn't Displayed And Allowclear Doesn't Work - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yiiwheels -> Whselect2 -> Plaseholder Isn't Displayed And Allowclear Doesn't Work Rate Topic: -----

#1 User is offline   Hitsi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 20-June 14

Posted 20 June 2014 - 06:41 AM

Hi.
i use yiiwheels 1.0.4 and have code
    $managerSelect = $this->widget('yiiwheels.widgets.select2.WhSelect2', array(
        'name' => 'client_id',
        'data' => CHtml::listData(Clients::model()->findAll(array('order' => 'name')), 'id', 'name'),
        'value' => $model->client_id,
        'language' => Yii::app()->language,
        'pluginOptions' => array(
            'placeholder' => 'Select',
            'allowClear' => true,
            'width' => '60%'
        )));

but placeholder isn't displayed and allowClear doesn't work.
i need clear selected item.

i try use whselectbox
$this->widget('yiiwheels.widgets.formhelpers.WhSelectBox', array(
        'name' => 'client_id',        
        'data' => CHtml::listData(Clients::model()->findAll(array('order' => 'name')), 'id', 'name'),
        'value' => $model->client_id,
        ));

but i don't know how add empty option to select form or clear selected item.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users