Exemple #1
0
 /**
  * Create grid.
  *
  * @param ViewInterface $view View object.
  * @param DIBehaviour   $di   DI object.
  */
 public function __construct(ViewInterface $view, $di = null)
 {
     $this->__DIConstruct($di);
     $this->_view = $view;
     $this->_view->grid = $this;
     /**
      * Prepare source data.
      */
     $paginator = $this->getSourceResolver()->resolve($this->getSource());
     $this->_paginator = $paginator->getPaginate();
     /**
      * Ajax call, we need to render only partials.
      */
     if ($this->getDI()->getRequest()->isAjax()) {
         $view->disable();
         $this->_response = $this->getDI()->getResponse();
         $this->_response->setContent($this->render($this->getTableBodyView()));
     }
 }