kartik-v / yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.
http://demos.krajee.com/dynagrid
Other
74 stars 66 forks source link

Remove column from toggleData (Hidden / Fixed Columns) #82

Closed andjelko closed 8 years ago

andjelko commented 9 years ago

I extend class Dynagrid

function setWidgetColumns

replace code

            if(!$column['noshow']) /// add this line
            { /// add this line
                $widgetColumns = [
                    'content' => (empty($indicator) ? '' : $indicator . ' ') . $this->getColumnLabel($key, $column),
                    'options' => ['id' => $key]
                ];

                if ($showAll && !$disabled) {
                    $visibleSettings[$key] = $widgetColumns;
                } elseif (in_array($key, $this->_visibleKeys) && !$disabled) {
                    $visibleSettings[$key] = $widgetColumns;
                } else {
                    $this->_hiddenColumns[] = $widgetColumns + ['disabled' => $disabled];
                }
            } /// add this line

and when i set parameter "noshow" to 0 that column are not show

kartik-v commented 8 years ago

If you have a suggestion for enhancement - please raise a pull request. Not clear with this query.