title: How to get value of checked gridview column
body: <p>Hi guys i have a gridview like below
  and i want to get the 'user_id' of the checked column
  how can i do that???</p>
  
  <p>I could easily get the checked column id but i dont know how to get data of those checked column in gridview
  i want to get it via javascript so that i can pass it to service</p>
  
  <pre><code>&lt;?= GridView::widget([
          'dataProvider' =&gt; $dataProvider,
          'filterModel' =&gt; $searchModel,
          'showOnEmpty'=&gt;true,
          'columns' =&gt; [
              ['class' =&gt; 'yii\grid\CheckboxColumn'],
              [
  
                  'attribute' =&gt; 'event_id',
                  'label' =&gt; 'Event Title',
                  'value' =&gt; 'event.title'
              ],
              [
                  'attribute' =&gt; 'user_id',
                  'label' =&gt; 'Email',
                  'value' =&gt; 'users.email',
              ],
              'user_type',
          ],
      ]);
   ?&gt;
  </code></pre>
  
  <p>and here is my javascript to get ids of checked column</p>
  
  <pre><code>jQuery(document).ready(function() {
  btnCheck  = $("#send");
  btnCheck.click(function() {
      var keys = $("#w0").yiiGridView("getSelectedRows");
    }
  });
  </code></pre>
  
  <p>Let me tell you the flow of this</p>
  
  <p>On homepage is a gridview like this
  <a href="https://i.stack.imgur.com/7M6tC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7M6tC.png" alt="enter image description here"></a>
  Now user will click on that small user sign and that will open the page you can see below</p>
  
  <p>Thats when i want to send messages to all selected users</p>
  
  <p><a href="https://i.stack.imgur.com/GMltG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GMltG.png" alt="enter image description here"></a>
  Because in my case <code>title</code> is from different table and <code>name</code> and <code>email</code> are from different table so i want <code>ids</code> of <code>user</code> table</p>
  
  <p>For that i want <code>user_id</code> but i am getting some random values 
  What can i do here???</p>
  
  <p>I tried this but its returning some random string</p>
  
  <pre><code>public function search($params)
  {
  
      if(!isset($_GET['id'])){
          $id='';
      }
      else{
          $id=$_GET['id'];
      }
  
      $query = Checkin::find()-&gt;where(['event_id'=&gt; $id]);
  
      $query-&gt;joinWith(['event', 'users']);
  
      $dataProvider = new ActiveDataProvider([
          'query' =&gt; $query,
      ]);
  
      $this-&gt;load($params);
  
      if (!$this-&gt;validate()) {
          return $dataProvider;
      }
  
      $query-&gt;andFilterWhere([
          'id' =&gt; $this-&gt;id,
          'created_date' =&gt; $this-&gt;created_date,
          'created_by' =&gt; $this-&gt;created_by,
          'updated_date' =&gt; $this-&gt;updated_date,
          'updated_by' =&gt; $this-&gt;updated_by,
      ]);
  
      $query-&gt;andFilterWhere(['like', 'user.email', $this-&gt;user_id]);
      $query-&gt;andFilterWhere(['like', 'user_type', $this-&gt;user_type]);
  
      $dataProvider-&gt;keys ='user_id';
  
      return $dataProvider;
  }
  </code></pre>