Message from webpage

I am using the CButtonColum part of the CGridView and I have some users that are not allowed to delete, when They click the delete button there is a "Message from webpage" window that opens up and shows source of a webpage. Is there a way to customize the message that is shown to make it a little more friendly?

Thanks, Joe

I suggest you to disable delete button if the user cant delete something.

By the way, … I dont know if is possible to change the message string.

That would be great, but im not sure how to diable the delete button and leave the view/edit button or I would have done that.

here is my gridview:




<?php

 $this->widget('zii.widgets.grid.CGridView', array(

	'id'=>'company-grid',

	'dataProvider'=>$model->search(),

	'columns'=>array(

		'COMPANY_NAME',

		array(

			'class'=>'CButtonColumn',

			'viewButtonUrl'=>'Yii::app()->createUrl("/company/view", array("id" => $data->ID_COMPANY_PK))',

			'deleteButtonUrl'=>'Yii::app()->createUrl("/company/delete", array("id" => $data->ID_COMPANY_PK))',

			'updateButtonUrl'=>'Yii::app()->createUrl("/company/update", array("id" => $data->ID_COMPANY_PK))',

				

		),

	),

));


?>



I have tried adding an if statement to the delete button to remove it if they are not allowed to delete, but it still shows, not sure how to do it?

Try something like this:


array(

	'class'=>'CButtonColumn',

	'viewButtonUrl'=>'Yii::app()->createUrl("/company/view", array("id" => $data->ID_COMPANY_PK))',

	'deleteButtonUrl'=>'Yii::app()->createUrl("/company/delete", array("id" => $data->ID_COMPANY_PK))',

	'updateButtonUrl'=>'Yii::app()->createUrl("/company/update", array("id" => $data->ID_COMPANY_PK))',

	'template' => user_cannot_delete ? '{view} {update}' : '{view} {update} {delete}',

),