@@ -83,7 +83,9 @@ |
||
| 83 | 83 | public function prepare() |
| 84 | 84 | { |
| 85 | 85 | $value = $this->getValue(); |
| 86 | - if (!$value || !is_numeric($value)) return; |
|
| 86 | + if (!$value || !is_numeric($value)) { |
|
| 87 | + return; |
|
| 88 | + } |
|
| 87 | 89 | $this->grid->getConfig()->getDataProvider()->setPageSize($value); |
| 88 | 90 | } |
| 89 | 91 | } |
@@ -21,7 +21,9 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public function __construct($func = null) |
| 23 | 23 | { |
| 24 | - if ($func) $this->setFunc($func); |
|
| 24 | + if ($func) { |
|
| 25 | + $this->setFunc($func); |
|
| 26 | + } |
|
| 25 | 27 | } |
| 26 | 28 | |
| 27 | 29 | /** |
@@ -77,7 +77,9 @@ |
||
| 77 | 77 | Event::listen( |
| 78 | 78 | DataProvider::EVENT_FETCH_ROW, |
| 79 | 79 | function (DataRow $row, DataProvider $currentProvider) use ($provider) { |
| 80 | - if ($currentProvider !== $provider) return; |
|
| 80 | + if ($currentProvider !== $provider) { |
|
| 81 | + return; |
|
| 82 | + } |
|
| 81 | 83 | $this->rows_processed++; |
| 82 | 84 | foreach ($this->fields as $field) { |
| 83 | 85 | $name = $field->getName(); |
@@ -1,7 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** @var Nayjest\Grids\Components\SelectFilter $component */ |
| 3 | 3 | $value = $component->getValue(); |
| 4 | -if (!is_array($value)) $value = []; |
|
| 4 | +if (!is_array($value)) { |
|
| 5 | + $value = []; |
|
| 6 | +} |
|
| 5 | 7 | $id = uniqid() . mt_rand(); |
| 6 | 8 | ?> |
| 7 | 9 | <div class="btn-group"> |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | * |
| 5 | 5 | * @var $grid Nayjest\Grids\Grid |
| 6 | 6 | */ |
| 7 | -use Nayjest\Grids\Components\ExcelDownload; |
|
| 8 | 7 | ?> |
| 9 | 8 | <span style="visibility:hidden"> |
| 10 | 9 | <a |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Nayjest\Grids\Components; |
| 4 | 4 | |
| 5 | -use Event; |
|
| 6 | 5 | use Illuminate\Pagination\Paginator; |
| 7 | 6 | use Illuminate\Foundation\Application; |
| 8 | 7 | use Maatwebsite\Excel\Classes\LaravelExcelWorksheet; |
@@ -4,16 +4,8 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Event; |
| 6 | 6 | use Illuminate\Support\Facades\Storage; |
| 7 | -use Illuminate\Pagination\Paginator; |
|
| 8 | -use Illuminate\Foundation\Application; |
|
| 9 | -use Maatwebsite\Excel\Classes\LaravelExcelWorksheet; |
|
| 10 | -use Maatwebsite\Excel\Excel; |
|
| 11 | -use Maatwebsite\Excel\Writers\LaravelExcelWriter; |
|
| 12 | 7 | use Nayjest\Grids\Components\Base\RenderableComponent; |
| 13 | 8 | use Nayjest\Grids\Components\Base\RenderableRegistry; |
| 14 | -use Nayjest\Grids\DataProvider; |
|
| 15 | -use Nayjest\Grids\DataRow; |
|
| 16 | -use Nayjest\Grids\FieldConfig; |
|
| 17 | 9 | use Nayjest\Grids\Grid; |
| 18 | 10 | |
| 19 | 11 | class ExcelDownload extends RenderableComponent |