Jump to content

how to get dialog text box when delete link is clicked in cbuttoncolumn using php


Recommended Posts

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")')),

),*/


),
),

),


));

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.