/** * Render the datagrid. * * @param $options * @param $columns * @param bool $showStart * @param bool $showColumns * @param bool $showEnd * @return string */ protected function render($options, $columns, $showStart, $showColumns, $showEnd) { $datagridOptions = $this->datagridHelper->mergeOptions($this->datagridOptions, $options); if (isset($datagridOptions['view']) && view()->exists($datagridOptions['view'])) { $datagridView = $datagridOptions['view']; } else { $datagridView = $this->datagridHelper->getConfig('datagrid_defaults.view'); } return $this->datagridHelper->getView()->make($datagridView)->with(compact('showStart', 'showColumns', 'showEnd'))->with('datagridOptions', $datagridOptions)->with('tableAttrs', $this->datagridHelper->prepareAttributes($this->getHtmlAttributes()))->with('columns', $columns)->with('exclude', $this->exclude)->with('data', $this->data)->render(); }
/** * Defaults used across all columns. * * @return array */ private function allDefaults() { return ['attr' => $this->datagridHelper->getConfig('column_defaults.attr'), 'label' => $this->datagridHelper->formatLabel($this->name), 'view' => $this->datagridHelper->getConfig('column_defaults.view')]; }