public function run() { $id = $this->options['id']; $options = Json::encode($this->getClientOptions()); $view = $this->getView(); InputGridAsset::register($view); $view->registerJs("jQuery('#{$id}').mdmInputGrid({$options});"); \yii\widgets\BaseListView::run(); }
/** * Runs the widget. */ public function run() { $id = $this->options['id']; $options = Json::htmlEncode($this->getClientOptions()); $view = $this->getView(); $view->registerJs("jQuery('#{$id}').yiiGridView({$options}).trigger('init');"); if ($this->sectionLoad) { $view->registerJs("jQuery('#{$id}').on('click', '.pagination a, .sort a', function(event) {jQuery('{$this->sectionLoad}').load(this.href);event.stopImmediatePropagation();return false;});"); } \yii\widgets\BaseListView::run(); }
/** * Initializes the grid view. * This method will initialize required property values and instantiate [[columns]] objects. */ public function init() { parent::init(); if ($this->formatter == null) { $this->formatter = Yii::$app->getFormatter(); } elseif (is_array($this->formatter)) { $this->formatter = Yii::createObject($this->formatter); } if (!$this->formatter instanceof Formatter) { throw new InvalidConfigException('The "formatter" property must be either a Format object or a configuration array.'); } $this->showOnEmpty = true; $this->emptyText = '<p>Currently Empty :(</p><p>Feel free to leave your comment!</p>'; $this->summary = ''; }
/** * @inheritdoc */ public function renderSection($name) { switch ($name) { case "{errors}": return $this->renderErrors(); default: return parent::renderSection($name); } }
/** * @inheritdoc */ public function renderSection($name) { switch ($name) { case '{errors}': return $this->renderErrors(); case '{pager}': return $this->renderPager(); default: return parent::renderSection($name); } }
public function run() { if ($this->runInConsoleMode == false) { GridViewAsset::register($this->getView()); parent::run(); } else { BaseListView::run(); } }
/** * Runs the widget. */ public function run() { $view = $this->getView(); FilemanagerAsset::register($view); parent::run(); }
/** * Runs the widget. */ public function run() { $id = $this->options['id']; $options = Json::encode($this->getClientOptions()); $view = $this->getView(); GridViewAsset::register($view); $view->registerJs("jQuery('#{$id}').yiiGridView({$options});"); parent::run(); }
/** * @inheritdoc */ public function run() { Html::addCssClass($this->tableOptions, 'table'); if ($this->hover) { Html::addCssClass($this->tableOptions, 'table-hover'); } if ($this->bordered) { Html::addCssClass($this->tableOptions, 'table-bordered'); } if ($this->striped) { Html::addCssClass($this->tableOptions, 'table-striped'); } $this->initLayout(); GridViewAsset::register($this->view); $options = Json::htmlEncode($this->getClientOptions()); $this->view->registerJs("\$('#{$this->options['id']}').yiiGridView({$options});"); if ($this->resizableColumns !== false) { $options = Json::htmlEncode($this->resizableColumnsOptions); $url = Url::toRoute($this->resizableColumnsUrl); $js = <<<JS \$('#{$this->options['id']}').resizableColumns({$options}).on('afterDragging.rc', function(event) { var column = \$(this).closest('[data-resizable-column]'), data = {}; data[column.data('resizable-column')] = column.outerWidth(); \$.ajax({ type: 'post', url: '{$url}', data: data }); }); JS; $this->view->registerJs($js); } BaseListView::run(); }