title: How to hide rows on condition from GridView?
body: <pre><code>   $query =Cms::find();
     $dataProvider = new ActiveDataProvider([
      'query' =&gt; $query ,
      ]);
  </code></pre>
  
  <p>Hi, I'm trying to hide certain rows whose 'Status_id' is set to 'Inactive' which is done using a custom action button I've created in the Actions column. I figured I might be able to do it if I could add my own query in the $dataprovider but I don't know how to do that too. Please help if it's the right way and if not how to do I do it? Thanks in advance.Here's my widget.</p>
  
  <pre><code>echo GridView::widget([
      'dataProvider' =&gt; $dataProvider,
      'filterModel' =&gt; $searchModel,
  
      'columns' =&gt; [
          'Contract_id',
          'Status_id',
              ['header' =&gt; 'Actions',
              'class' =&gt; 'yii\grid\ActionColumn',
              'template' =&gt; '{new_action}',
              'buttons' =&gt; [
                  'new_action' =&gt; function ($url) {
                      return Html::a('&lt;span class="glyphicon glyphicon-fire"&gt;&lt;/span&gt;', $url, [
                                  'title' =&gt; Yii::t('app', 'Burn Contract'),
                                  'data-confirm' =&gt; Yii::t('yii', 'Are you sure you want to burn this contract?'),
                                  'data-method' =&gt; 'post', 'data-pjax' =&gt; '0',
                      ]);
                  }
              ], 'urlCreator' =&gt; function ($action, $model) {
                  if ($action === 'new_action') {
                      $url = Url::to(['cms/burn', 'id' =&gt; $model-&gt;Contract_id]);
                      return $url;
                  }
              }
          ],
      ],
  ]);
  </code></pre>