I have tender table which has none to many acc managers. i used kartik select2 widget to save those via TenderAccManager model.

Here, tender\_acc\_maanger table stores tender and acc\_manager tables id.

Now i want to show the acc managers name (accManager is the relation name in TenderAccManager model)in comma separated way in gridview, 
so far i came up with this (inside gridview widget):

```
[
    'label' => 'A/C Manager Name',
    'format' => 'raw',
    'value' => function($data) {
        $accManagers = TenderAccManager::find()
            ->where(['tender_id' => $data->id])
            ->all();

        $value = '';
        $i = 0;
        foreach($accManagers as $accManager) {
            if($i > 0) {
                $value .= ', ';
            }
            $value .= $accManager->accManager->name;
            $i++;
        }

        return $value;
    }
],

```

the code is working, but i want the searching and sorting function too like other fields in gridview, how can i do that?