Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Cgridview Delete Option

$
0
0
I everyone i have a cgridview and the data provider is from a diferent model so i have changed the button options , and all worked fine.One problem: When i press the delete option the row is eliminated but the cgridview desapear.

here my delete button
array
  (
	  'class'=>'CButtonColumn',
	  'template'=>'{view}{update}{delete}',
	  'buttons'=>array(
	  	  
		  'delete' => array
		  (
			  'url'=>'Yii::app()->createUrl("linha_notificacao/delete", array("id"=>$data->n_linha_notificacao))',
			  			   'options'=>array('title'=>'Apagar...')
		  ),
		  ),
		  ),
	),

here is the delete control function

public function actionDelete($id)
	{
		$this->loadModel($id)->delete();
		
		// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
		if(!isset($_GET['ajax']))
			$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
	}



what i should do on the controller function ? Maybe redirect back to the view ? Help please :)

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>