public function searchByName(){
$criteria = new CDbCriteria;
$criteria->compare('name_ru ',"петух",true);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
'pagination'=>array(
'pageSize'=> 999,
)
));
}
$myarray[] = array(
'class' => 'CButtonColumn', //кнопка
'template' => '{add}',
'buttons' => array(
'add' => array(//the name {reply} must be same
'label' => '+', // text label of the button
'visible'=> '$data->type == 3',
'url' => '$data->id."|".$data->name."|".$data->type',
'click' => 'function(){
data=$(this).attr("href").split("|")
if (data[2] == 3){
$("#myModalHeader").html(data[1]);
$("#myModalBody").load("' . $this->createUrl('analizCreate/modalcreate') . '/?id="+data[0]+"");
$("#myModal").modal();}
return false;
}',
////Your URL According to your wish
'options' => array(
'class' => 'btn btn-small btn-success' ,
),
),
),
<?php $this->widget('bootstrap.widgets.TbGridView',array(
'id'=>'ref-mahala-grid',
'dataProvider'=>$model->with('region')->search(),
'filter'=>$model,
'columns'=>array(
'id',
// 'district_id',
'region.нужное поле из класса RefRegion'
'name_ru',
'name_uz',
'name_en',
'address_ru',
array(
'class'=>'bootstrap.widgets.TbButtonColumn',
),
),
)); ?>