jackhad
(Jackhad)
June 18, 2013, 5:32am
1
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'),
),
),
mmbalaa
(Mmbalasundaram)
June 18, 2013, 7:00am
3
try this after url and relace the condition what you need
....
'url'=> $this->createUrl('inquiryBook/inupdate'),
'visible'=>'$data->status=="O"?TRUE:FALSE',
....
CGridview Buttoncolumn
mirunho
(D Mirecki)
June 18, 2013, 7:54am
4
why visible? he didnt mention that he want to hide it …
jackhad
(Jackhad)
June 18, 2013, 10:35am
5
try this after url and relace the condition what you need
....
'url'=> $this->createUrl('inquiryBook/inupdate'),
'visible'=>'$data->status=="O"?TRUE:FALSE',
....
not works error: Property “TbEditableField.visible” is not defined.
jackhad
(Jackhad)
June 19, 2013, 5:28am
8
mirunho:
any error?
show your full code
No…its shows like Empty text with editable link refer the image first row4419
mirunho
(D Mirecki)
June 19, 2013, 6:27am
9
Did You try set
'enabled'=> false,
and see what happen ? It works perfectly fine for me so Its hard to say what is wrong.
jackhad
(Jackhad)
June 19, 2013, 6:52am
10
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,
),
),