Hi,
I try using EchMultiSelect(header column) in bootstrap.widgets.TbGridView
my code:
$data1 = CHtml::listData(Wojewodztwa::model()->findAll(), 'id', 'id'); //?
$data2 = CHtml::listData(Wojewodztwa::model()->findAll(), 'nazwa', 'nazwa');
$model = Wojewodztwa::model();
//
//zii.widgets.grid.CGridView
$this->widget('bootstrap.widgets.TbGridView', array(
'id' => 'grid_id',
'dataProvider' => $subscriberActiveDataProvider,
'filter' => $model,
'type' => 'striped bordered',
'columns' => array(
//first column
array(
'name' => 'id',
'value' => '$data->id',
'filter' => $this->widget('ext.EchMultiselect.EchMultiselect', array(
'model' => $model,
'dropDownAttribute' => 'id',
'data' => $data1,
'dropDownHtmlOptions' => array(
'style' => 'width:378px;',
'multiple' => true,
'id' => 'id',
),
'options' => array(
'noneSelectedText' => '' . Yii::t('EchMultiSelect.EchMultiSelect', 'Wybierz nr') . '',
'buttonWidth' => 200, 'ajaxRefresh' => true, 'show' => ['slide', 500],
'hide' => ['explode', 500],
),
), true
)
),
// second column
array(
'name' => 'nazwa',
'value' => '$data->nazwa',
//'header' => CHtml::image("images/pobaw_miniaturka.png", "nazwa"),
'filter' => $this->widget('ext.EchMultiselect.EchMultiselect', array('model' => $model,
'dropDownAttribute' => 'nazwa',
'data' => $data2,
'options' => array('buttonWidth' => 120, 'ajaxRefresh' => false, 'show' => ['slide', 500], 'hide' => ['explode', 500], 'classes' => 'dynamic_multiselect'),
), true
),
),
//end
),
));
when i click EchMultiselect i’m not see change view my table or console firebug i see change view.
My controller:
public function actionIndex() {
$dana = array();
$criteria = new CDbCriteria;
if (isset($_GET['ajax']))
$dana = $_GET['Wojewodztwa'];
$warunek = null;
$i = 0;
foreach ($dana as $key => $value) {
if (!empty($value)) {
$warunek = $value[$i];
++$i;
}
}
$criteria->condition = 'nazwa LIKE :nazwa';
$criteria->params = array(':nazwa' => $warunek);
$subscriberActiveDataProvider = new CActiveDataProvider('Wojewodztwa', array(
'criteria' => $criteria,
));
$grid_id = 'subscriber_grid';
$this->render('index', array('subscriberActiveDataProvider' => $subscriberActiveDataProvider,
'grid_id' => $grid_id));
How correct my view?
Best regards
Jarek