How To Remove The Editable Option For Specific Row In Yii Gird View

This is my code for inline edit using Bootstrap widget.but I want to remove for this inline edit option.like if candidate_status value== enrolled,that shouldn’t be editable


array(

        'name' => 'candidate_status',

        'header' => 'Status',

        'class' => 'bootstrap.widgets.TbEditableColumn',

        'filter'=>CHtml::DropDownList('InquiryBook[candidate_status]', 'candidate_status',

                            array('Followup'=>'Followup','Interested'=>'Interested','Not Interested'=>'Not Interested','Contact'=>'Contact','Enrolled'=>'Enrolled'),

                            array('style'=>'width:auto;','prompt'=>'Select')),

        'headerHtmlOptions' => array('style' => ''),

        'editable' => array('type' => 'select',

                            'source'=> array('Followup', 'Interested', 'Not Interested','Contact'),

                            'url'=> $this->createUrl('inquiryBook/inupdate'),

                            ),


    ),

Hi, try this:

try this after url and relace the condition what you need




....

'url'=> $this->createUrl('inquiryBook/inupdate'),

'visible'=>'$data->status=="O"?TRUE:FALSE',

....



CGridview Buttoncolumn

why visible? he didnt mention that he want to hide it …

not works error: Property “TbEditableField.visible” is not defined. :(

not works man :(

any error?

show your full code

No…its shows like Empty text with editable link refer the image first row4419

griderror.png

Did You try set


'enabled'=> false,

and see what happen ? It works perfectly fine for me so Its hard to say what is wrong.

Normally ‘enabled’=>false works! but when I use


'enabled'=>$data->candidate_status=='Enrolled' ? false : true 

Not works :(

full code




array(

			'name' => 'candidate_status',

			'header' => 'Status',

			'class' => 'bootstrap.widgets.TbEditableColumn',

			'filter'=>CHtml::DropDownList('InquiryBook[candidate_status]', 'candidate_status',

								array('Followup'=>'Followup','Interested'=>'Interested','Not Interested'=>'Not Interested','Contact'=>'Contact','Enrolled'=>'Enrolled'),

								array('style'=>'width:auto;','prompt'=>'Select')),

			'headerHtmlOptions' => array('style' => ''),

			'editable' => array('type' => 'select',

								'source'=> array('Followup', 'Interested', 'Not Interested','Contact'),

								'url'=> $this->createUrl('inquiryBook/inupdate'),

								'enabled'=>$data->candidate_status=='Enrolled' ? false : true,

								),

			

		),