title: Yii2 GridView search dependent dropdown
body: <p>I am using Yii2 gridview to load country, state,city. I have set search option for country, state, city using dropdown. How do I create dependent dropdown in filter?</p>
  
  <pre><code>&lt;?= GridView::widget([
      'dataProvider' =&gt; $dataProvider,
      'filterModel' =&gt; $searchModel,
      'columns' =&gt; [
           [
          'attribute' =&gt; 'country_id',
          'label' =&gt; 'Country',
          'filter' =&gt; Country::country(),
          'value' =&gt; function($data){
          return Country::countryname($data-&gt;country_id);
          }
           ],
          [
  
            'attribute' =&gt; 'state_id',
            'filter' =&gt; State::state(),
            'value' =&gt; function($data){
              return State::statename($data-&gt;state_id);
            }
          ],
           [
  
            'attribute' =&gt; 'city_id',
            'filter' =&gt; City::city(),
            'value' =&gt; function($data){
              return City::cityname($data-&gt;city_id);
            }
          ],
  
  ]); ?&gt;
  </code></pre>