mubeensamoon Posted June 5, 2015 Share Posted June 5, 2015 currently I am getting the confirmation message "Are you sure want you would like to delete?" when the delete link is clicked in cButtonColumn. But I want a text dialog box for user to enter the comments for deletion then If he clicks Ok after entering comments then it should be deleted from DB. Code: array('header'=>'Action','class'=>'CButtonColumn','template'=>'{AnnouncementLetter}<br/>{EditAnnouncement}<br/>{SendReminder}<br/>{ViewAnnouncementSegment}<br/>{AcknowledgementFinance}<br/>{AcknowledgementSegment}<br/>{Delete}<br/><br/>'/*{DeletePrf}*//*{Extend}'{AnnouncementSend}<br/>*/,'buttons'=>array('AnnouncementLetter'=>array('label'=>'Create Letter','url' =>'CController::createUrl("/rebate/create", array("prfnumber"=>$data->prf_number,))','visible'=>'$data->nacknowledged == 0 AND (Yii::app()->user->type == 2 OR Yii::app()->user->type == 1)',//Filter User here Ops Team/Claim Team/Admin. Announcement letter checker//Show Draft letter ),'AnnouncementSend'=>array('label'=>'Send','url' =>'CController::createUrl("/prf/mail", array("prfnumber"=>$data->prf_number))',//need to use ajax instead here'visible'=>'(Yii::app()->user->type == 1 OR Yii::app()->user->type == 2) AND($data->nacknowledged==1 )',),'EditAnnouncement'=>array('label'=>'Edit Letter','url' =>'CController::createUrl("/rebate/create", array("prfnumber"=>$data->prf_number,))','visible'=>'($data->nacknowledged==1 OR $data->nacknowledged==5) AND (Yii::app()->user->type == 2 OR Yii::app()->user->type == 1)',),'SendReminder'=>array('label'=>'Send Reminder','url'=>'CController::createUrl("/prf/ReminderMail", array("prfnumber"=>$data->prf_number))','visible'=>'(Yii::app()->user->type == 1|| Yii::app()->user->type==2) && ($data->nacknowledged==3 OR $data->nacknowledged == 2)','options'=>array('ajax'=>array('success'=>'js:function(){alert("Reminder Sent")}','url'=>'js:$(this).attr("href")')), ),'ViewAnnouncementSegment'=>array('label'=>'View Announcement','url'=>'CController::createUrl("/annletter/segmentAcknowledge", array("prfnumber"=>$data->prf_number))','visible'=>'(Yii::app()->user->type == 1 OR Yii::app()->user->type != 5) && ($data->nacknowledged==4 OR $data->nacknowledged==4)',),'AcknowledgementFinance'=>array('label'=>'Acknowledge','url'=>'CController::createUrl("/annletter/segmentAcknowledge", array("prfnumber"=>$data->prf_number))','visible'=>'(Yii::app()->user->type == 1 OR Yii::app()->user->type==6) && ($data->nacknowledged==2)',),'AcknowledgementSegment'=>array('label'=>'Acknowledge','url'=>'CController::createUrl("/annletter/segmentAcknowledge", array("prfnumber"=>$data->prf_number))','visible'=>'(Yii::app()->user->type == 1 OR Yii::app()->user->type==4) && ($data->nacknowledged==3)',),'Delete'=>array('label'=>'Delete','url'=>'CController::createUrl("/prf/deleteRecord", array("prfnumber"=>$data->prf_number))','visible'=>'(Yii::app()->user->type == 6 AND $data->nacknowledged==4) OR Yii::app()->user->type == 1 ','options'=>array('confirm'=>'Are you sure you would like to delete?',/* 'ajax'=>array('success'=>'js:function(){alert("PRF Deleted")}','url'=>'js:$(this).attr("href")')*/),),/*'DeletePrf'=>array('label'=>'Delete','url'=>'CController::createUrl("/prf/silentDelete", array("prfnumber"=>$data->prf_number))','visible'=>'(Yii::app()->user->type == 6 AND $data->nacknowledged != 4) OR Yii::app()->user->type == 1 ','options'=>array('confirm'=>'Are you sure you would like to delete?',/* 'ajax'=>array('success'=>'js:function(){alert("PRF Deleted")}','url'=>'js:$(this).attr("href")')),),*/),),),)); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.