Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

MultiSelect as column in yii2 GridView #11

Open
Tlopasha opened this issue Nov 22, 2016 · 1 comment
Open

MultiSelect as column in yii2 GridView #11

Tlopasha opened this issue Nov 22, 2016 · 1 comment
Labels

Comments

@Tlopasha
Copy link

is it possible to use MultiSelect widget as column in GridView ?

for example :

GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'layout'=>"{items}",
        'showOnEmpty' => true,
        'columns' => [
        			[
        				'attribute' =>'itemgroup_id',
        				'content' => function($data){ return $data->itemgroup->getTitle(); } ,
        				'filter'=> MultiSelect::widget([
                                        'id'=>"multiXX",
                                       "options" => ['multiple'=>"multiple"], 
                                       'data' => [ 0 => 'super', 2 => 'natural'], 
                                       'value' => [ 0, 2], 
                                       'name' => 'multti',
                                      "clientOptions" => 
                                        [
                                          "includeSelectAllOption" => true,
                                          'numberDisplayed' => 2
                                            ], ])]>`
@tonydspaniard
Copy link
Member

tonydspaniard commented Feb 8, 2017

It shouldn't be a problem. But you need to set the filter to the widget. Here with the date: http://www.2amigos.us/blog/how-to-add-a-date-range-picker-to-filter-for-dates-on-a-gridview-for-yii2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants