Пример #1
0
 /**
  * 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');
 }
Пример #2
0
 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();
 }
Пример #3
0
 public function prepare()
 {
     parent::prepare();
     $visible = $this->getColumnsVisibility();
     foreach ($this->grid->getConfig()->getColumns() as $column) {
         if (!$visible[$column->getName()]) {
             $column->hide();
         }
     }
 }
Пример #4
0
 /**
  * @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();
         }
     });
 }
Пример #5
0
 /**
  * @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();
         }
     });
 }
Пример #6
-1
 /**
  * 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');
 }
Пример #7
-1
 public function initialize(Grid $grid)
 {
     parent::initialize($grid);
     $this->input_key = $grid->getInputProcessor()->getKey();
     $this->setupPaginationForReading();
 }
Пример #8
-1
 protected function getViewData()
 {
     return parent::getViewData() + ['column' => $this->column];
 }