leantony / laravel-grid

A grid view for laravel, inspired by the yii2 grid widget
https://leantony.github.io/laravel-grid/
MIT License
91 stars 39 forks source link

Issue : Change Toolbar size settings when search box is not rendered #83

Open Nuranto opened 5 years ago

Nuranto commented 5 years ago
public function getGridToolbarSize(): array
    {
        if ($this->toolbarSize === null) {
            $this->toolbarSize = config('grid.toolbar_size', [6, 6]);
        }
        return $this->toolbarSize;
    }

Quick solution, but ugly :

public function getGridToolbarSize(): array
    {
        if ($this->toolbarSize === null) {
            $size = $this->shouldRenderSearchForm ? config('grid.toolbar_size', [6, 6]) : [12/*dummy...*/,12];
            $this->toolbarSize = $size;
        }
        return $this->toolbarSize;
    }

It would probably requires some refactoring in grid template ?