title: Yii gridview How to set editable option based on the data
body: <p>This is my grid view code <br></p>
  
  <pre><code>&lt;?= GridView::widget([
      'dataProvider' =&gt; $dataProvider,
      'filterModel' =&gt; $searchModel,
      'toolbar'=&gt; [
          ['content'=&gt;
              Html::a('&lt;i class="glyphicon glyphicon-plus"&gt;&lt;/i&gt; Add New', ['create'],['class'=&gt;'btn btn-shadow btn-success'])
          ],
          '{toggleData}',
      ],
      'columns' =&gt; [
          ['class' =&gt; 'kartik\grid\SerialColumn'],
          [
              'attribute'=&gt;'Name',
              'vAlign'=&gt;GridView::ALIGN_MIDDLE,
          ],
          [
              'attribute'=&gt;'Age',
              'vAlign'=&gt;GridView::ALIGN_MIDDLE,
              'value'=&gt;'Age',
              'width'=&gt;'5%',
              'hAlign'=&gt;'center',
          ],
          [
              'attribute'=&gt;'Address',
              'vAlign'=&gt;GridView::ALIGN_MIDDLE,
          ],
          [
              'class' =&gt; 'kartik\grid\EditableColumn',
              'attribute'=&gt;'Status',
              'vAlign'=&gt;GridView::ALIGN_MIDDLE,
              'hAlign'=&gt;GridView::ALIGN_CENTER,
              'width'=&gt;'15%',
              'filterType'=&gt;GridView::FILTER_SELECT2,
              'filterWidgetOptions'=&gt;[
                  'options' =&gt; ['placeholder' =&gt; 'Search Status...'],
                  'pluginOptions' =&gt; [
                      'allowClear' =&gt; true
                  ],
              ],
              'value'=&gt;function($model){
                  return ($model-&gt;Status=='0'?'Pending':($model-&gt;Status=='1'?'Accepted':'Rejected'));},
              'filter'=&gt;['Pending','Diterima'],
              'label' =&gt; 'Status',
              'refreshGrid'=&gt;true,
              'editableOptions'=&gt;[
                  'format' =&gt; Editable::FORMAT_BUTTON,
                  'asPopover' =&gt; true,
                  'inputType' =&gt; Editable::INPUT_DROPDOWN_LIST,
                  'data'=&gt;['0'=&gt;'Pending', '1'=&gt;'Accepted', '2'=&gt;'Rejected'],
                  'options' =&gt; ['class'=&gt;'form-control'],
              ]
          ],
          [
              'class' =&gt; 'kartik\grid\ActionColumn',
              'template' =&gt; '
                  &lt;li&gt;{view}&lt;/li&gt;
                  &lt;li&gt;{update}&lt;/li&gt;
                  &lt;li&gt;{delete}&lt;/li&gt;',
              'dropdown'=&gt;true,
              'dropdownOptions'=&gt;['class'=&gt;'pull-right'],
              'headerOptions'=&gt;['class'=&gt;'kartik-sheet-style'],
          ],
      ],
      'panel'=&gt;[
          'type'=&gt;GridView::TYPE_DEFAULT,
      ]
  ]); ?&gt;
  </code></pre>
  
  <p>Help me with the Status attribute. The result from this gridview is like this :<br>
  <a href="https://i.stack.imgur.com/6YZen.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6YZen.jpg" alt="enter image description here"></a></p>
  
  <p>what i want is like this : <br>
  <a href="https://i.stack.imgur.com/QdRIX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QdRIX.jpg" alt="enter image description here"></a></p>
  
  <p>So, it's like when the Status is Pending, the editableOption is on.But when the Status is Accepted or Rejected, the editableOption is disable. Is that possible ?</p>