0

I want to hide a column in my gridview using kartik gridview. But when i do something like that :

$gridColumns = [
[
    'class' => 'kartik\grid\DataColumn',
    'attribute'=>'name', 
    'hidden' => 'true',
],

My column is still visible .

Jimo
  • 3
  • 2

3 Answers3

2

It is a boolean column, not a string. You should put:

'hidden' => true,
gmc
  • 3,910
  • 2
  • 31
  • 44
0

Use visible instead:

`visible` => false
topher
  • 14,790
  • 7
  • 54
  • 70
  • `hidden` should work too, the only difference is that with `hidden` the column is shown if you export the table to a file – gmc Mar 24 '17 at 09:27
0

I know it and old question, but I wanted to add that if you want columns to be hidden in grid, but available for export use 'hidden' => false instead of 'visble' => true

Daniel G
  • 175
  • 1
  • 10