yii - CGridView filter ajax update is not happening -
im using cgridview display records. filter not working in application. instead of ajax update complete page gets reloaded. want filter records using ajax call. here code.
$this->widget('zii.widgets.grid.cgridview', array( 'id'=>'mage-grid', 'dataprovider'=>$model->search(), 'filter'=>$model, 'ajaxupdate'=>true, 'columns'=>array( 'entity_id', 'name', 'sku', 'type_id', 'price', //'status', array( 'name'=>'status', 'header'=>'status', 'filter'=>array('1'=>'enabled','2'=>'disabled'), 'value'=>'($data->status=="1")?("enabled"):("disabled")' ), array( 'class'=>'cbuttoncolumn', 'template' => '{update}{delete}', // 'viewbuttonurl'=>'yii::app()->controller->createurl("/ad/view",array("id"=>$data["id"]))', 'buttons' =>array( 'update' => array( 'url'=>'yii::app()->controller->createurl("/mageproduct/update",array("pid"=>$data["entity_id"],"sid"=>shop_id))', 'imageurl'=>yii::app()->request->baseurl.'/images/icons/dark/create_write.png', ), 'delete' => array( 'url'=>'yii::app()->controller->createurl("/mageproduct/delete",array("pid"=>$data["entity_id"],"sid"=>shop_id))', 'imageurl'=>yii::app()->request->baseurl.'/images/icons/dark/trashcan.png', // 'deleteconfirmation' => 'delete?', ) ), ), ),
here controller action
public function actionadmin() { $model=new mageproduct('search'); $model->unsetattributes(); // clear default values if(isset($_get['mageproduct'])) $model->attributes=$_get['mageproduct']; $this->render('admin' ,array( 'model' =>$model, )); }
note: im using carraydataprovider.
Comments
Post a Comment