/** * Passing $from, $to, $total to view * @return mixed */ protected function getViewData() { $paginator = $this->grid->getConfig()->getDataProvider()->getPaginator(); $from = $paginator->getFrom(); $to = $paginator->getTo(); $total = $paginator->getTotal(); return parent::getViewData() + compact('from', 'to', 'total'); }
public function initialize(Grid $grid) { parent::initialize($grid); $this->pagination_factory = $grid->getConfig()->getDataProvider()->getPaginationFactory(); $this->previous_page_name = $this->pagination_factory->getPageName(); $this->input_key = $grid->getInputProcessor()->getKey(); $this->setupPaginationForReading(); }
public function prepare() { parent::prepare(); $visible = $this->getColumnsVisibility(); foreach ($this->grid->getConfig()->getColumns() as $column) { if (!$visible[$column->getName()]) { $column->hide(); } } }
/** * @param Grid $grid * @return null|void */ public function initialize(Grid $grid) { parent::initialize($grid); Event::listen(Grid::EVENT_CREATE, function (Grid $grid) { $this->grid = $grid; if ($grid->getInputProcessor()->getValue(static::INPUT_PARAM, false)) { $this->renderCsv(); } }); }
/** * @param Grid $grid * @return null|void */ public function initialize(Grid $grid) { parent::initialize($grid); Event::listen(Grid::EVENT_PREPARE, function (Grid $grid) { if ($this->grid !== $grid) { return; } if ($grid->getInputProcessor()->getValue(static::INPUT_PARAM, false)) { $this->renderExcel(); } }); }
/** * Passing $from, $to, $total to view * @return mixed */ protected function getViewData() { $paginator = $this->grid->getConfig()->getDataProvider()->getPaginator(); # Laravel 4 if (method_exists($paginator, 'getFrom')) { $from = $paginator->getFrom(); $to = $paginator->getTo(); $total = $paginator->getTotal(); # Laravel 5 } else { $from = $paginator->firstItem(); $to = $paginator->lastItem(); $total = $paginator->total(); } return parent::getViewData() + compact('from', 'to', 'total'); }
public function initialize(Grid $grid) { parent::initialize($grid); $this->input_key = $grid->getInputProcessor()->getKey(); $this->setupPaginationForReading(); }
protected function getViewData() { return parent::getViewData() + ['column' => $this->column]; }