run() public method

Runs the widget.
public run ( )
示例#1
1
    public function run(){

        if($this->is_pjax){
            Pjax::begin($this->pjaxOptions);
        }

        parent::run();

        if($this->isShowForm) {
            echo PageSize::widget([
                'model'     => $this->filterModel,
                'attribute' => $this->attribute,
                'options'   => [
                    'data-pjax' => '0',
                ],
            ]);
        }

        if($this->is_pjax){
            Pjax::end();
        }

        echo ModelCrud::widget([
            'size' => $this->modalSize,
            'updateUrl' => ($this->updateUrl)? $this->updateUrl : Url::to(['update']),
            'createUrl' => ($this->createUrl)? $this->createUrl : Url::to(['create']),
            'updateVerb' => 'post',
            'viewUrl' => Url::to(['view']),
            'viewVerb' => 'post',
            'createVerb' => 'post',
            'modelTitle' => $this->modelTitle,
            'template' => '{view}{update}{create}',
            'modelClass' =>  $this->dataProvider->query->modelClass
        ]);
    }
示例#2
0
文件: GridView.php 项目: Liv1020/cms
 /**
  * Runs the widget.
  */
 public function run()
 {
     $this->pjaxBegin();
     parent::run();
     $this->registerAsset();
     $this->pjaxEnd();
 }
示例#3
0
 public function run()
 {
     $this->prepareVisibilityColumns();
     echo Html::beginTag('div', ['class' => 'kak-grid']);
     parent::run();
     echo Html::endTag('div');
 }
示例#4
0
 public function run()
 {
     parent::run();
     echo '</div>';
     if (!$this->options['ajax']) {
         $this->registerClientScripts();
         DataTablesAsset::register($this->getView());
     }
 }
示例#5
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     $loaderJs = '$(document).ready(function () {
             $(".grid-view-loading").show();
             $(".grid-view-loading").css("display", "block !important");
             $(".grid-view-loading").css("opacity", "1 !important");
     });';
     $this->getView()->registerJs($loaderJs);
     return parent::run();
 }
示例#6
0
 /**
  * Runs the widget.
  */
 public function run()
 {
     parent::run();
     $view = $this->getView();
     AdminDataTableAsset::register($view);
     $id = $this->options['id'];
     $view->registerJs('var extensions =' . Json::encode($this->datatable_options) . ' ;', View::POS_READY);
     $view->registerJs('$.extend($.fn.dataTableExt.oStdClasses, extensions);', View::POS_READY);
     $view->registerJs('var ' . $id . ' = $(".' . $this->tableDataClass . '").dataTable();', View::POS_READY);
 }
 public function run()
 {
     foreach ($this->columns as $column) {
         if (property_exists($column, 'enableSorting')) {
             $column->enableSorting = false;
         }
     }
     parent::run();
     $options = ['id' => $this->id, 'action' => $this->sortUrl, 'sortingPromptText' => $this->sortingPromptText, 'sortingFailText' => $this->failText, 'csrfTokenName' => \Yii::$app->request->csrfParam, 'csrfToken' => \Yii::$app->request->csrfToken];
     $options = Json::encode($options);
     $this->view->registerJs("jQuery.SortableGridView({$options});");
 }
 public function run()
 {
     $view = $this->getView();
     SortableAsset::register($view);
     $options = '';
     if ($this->sortOptions !== null) {
         $options = Json::encode($this->sortOptions);
     }
     $id = $this->options['id'];
     $view->registerJs("jQuery('#{$id} table tbody').sortable({$options});");
     parent::run();
 }
示例#9
0
 public function run()
 {
     //$this->test();
     $this->init_provider();
     $this->init_excel_sheet();
     $this->initPHPExcelWriter('Excel5');
     $this->generateHeader();
     $row = $this->generateBody();
     $writer = $this->_objPHPExcelWriter;
     $this->setHttpHeaders();
     $writer->save('php://output');
     Yii::$app->end();
     //$writer->save('test.xlsx');
     parent::run();
 }
示例#10
0
 public function run()
 {
     if ($this->box) {
         if ($this->responsive) {
             $this->box['body']['class'] = 'table-responsive';
         }
         self::boxBegin($this->box);
     } elseif ($this->responsive) {
         Html::beginTag('div', ['class' => 'table-responsive']);
     }
     parent::run();
     if ($this->box) {
         self::boxEnd();
     } elseif ($this->responsive) {
         Html::endTag('div');
     }
 }
示例#11
0
 /**
  * @inheritdoc
  * @throws InvalidConfigException
  */
 public function run()
 {
     $this->initToggleData();
     $this->initExport();
     if ($this->export !== false && isset($this->exportConfig[self::PDF])) {
         \kartik\base\Config::checkDependency('mpdf\\Pdf', 'yii2-mpdf', "for PDF export functionality. To include PDF export, follow the install steps below. If you do not " . "need PDF export functionality, do not include 'PDF' as a format in the 'export' property. You can " . "otherwise set 'export' to 'false' to disable all export functionality");
     }
     $this->initHeader();
     $this->initBootstrapStyle();
     $this->containerOptions['id'] = $this->options['id'] . '-container';
     Html::addCssClass($this->containerOptions, 'kv-grid-container');
     $this->registerAssets();
     $this->renderPanel();
     $this->initLayout();
     $this->beginPjax();
     parent::run();
     $this->endPjax();
 }
示例#12
0
 public function run()
 {
     $this->trigger(self::EVENT_BEFORE_RUN);
     parent::run();
     $this->trigger(self::EVENT_AFTER_RUN);
 }
示例#13
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     parent::run();
     DataTablesAsset::register($this->getView());
 }
示例#14
0
 public function run()
 {
     $this->registerResizableColumns();
     parent::run();
 }
示例#15
0
 public function run()
 {
     GridViewAsset::register($this->view);
     parent::run();
 }
示例#16
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     $exportMenu = $this->renderExportMenu();
     $this->layout = strtr($this->layout, ['{export}' => $exportMenu]);
     parent::run();
 }
示例#17
0
 public function run()
 {
     parent::run();
 }
示例#18
0
 /**
  * Runs the widget.
  */
 public function run()
 {
     /*$id = $this->options['id'];
       $options = Json::htmlEncode($this->getClientOptions());
       $view = $this->getView();
       GridViewAsset::register($view);
       $view->registerJs("jQuery('#$id').yiiGridView($options);");*/
     parent::run();
 }
示例#19
0
 public function run()
 {
     if ($this->runInConsoleMode == false) {
         GridViewAsset::register($this->getView());
         parent::run();
     } else {
         BaseListView::run();
     }
 }
示例#20
0
 public function run()
 {
     TabularAsset::register($this->view);
     //Get rid of pagination.
     $this->dataProvider->pagination->pageSize = 500000;
     //make sure we have a post model
     if (empty($this->postModel)) {
         throw new InvalidConfigException("You need a postModel for the TabularInput widget");
     }
     if ($this->fooTableOptions) {
         $this->tableOptions['class'] .= ' footable';
         /**
          * :TODO: Footables does not work with 2 header rows. So the filter is disabled if we use footables
          */
         $this->filterPosition = false;
         foreach ($this->fooTableOptions['columns'] as $column => $device) {
             if (!empty($this->columns[$column - 1])) {
                 $this->columns[$column - 1]->headerOptions['data']['hide'] = $device;
             } else {
                 Yii::error('You have assigned Foo Table options to non-existent columns');
             }
         }
         $this->registerFooScript();
     }
     //if there are fewer rows that our $minRows then add some empty models
     if ($this->dataProvider->totalCount < $this->minRows) {
         $nRowsToAdd = $this->minRows - $this->dataProvider->totalCount;
         for ($x = 1; $x <= $nRowsToAdd; $x++) {
             $className = $this->filterModel->className();
             $newModel = new $className();
             $newModels[] = $newModel;
         }
         $this->dataProvider->setModels($newModels);
     }
     if ($this->footerAddButton) {
         $this->showFooter = true;
         if (empty($this->footerAddButton['options'])) {
             $this->footerAddButton['options'] = ['class' => 'btn btn-primary', 'id' => $this->id . '-addbutton-footer'];
             //StringHelper::basename($this->postModel->className()).'-tabular-addbutton'];
         }
         $this->footerButtonContent = Html::button($this->footerAddButton['label'], $this->footerAddButton['options']);
     }
     $this->tableRowMarkup = $this->renderTableRow($this->postModel, 'key', '1');
     Yii::info($this->tableRowMarkup);
     parent::run();
 }
示例#21
0
 /**
  * @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();
     parent::run();
 }
示例#22
0
 public function run()
 {
     FootableAsset::register($this->getView());
     $this->registerScript();
     parent::run();
 }
 public function run()
 {
     $this->registerWidget();
     parent::run();
 }
示例#24
0
 public function run()
 {
     if ($this->bootstrap && is_array($this->panel) && !empty($this->panel)) {
         $this->renderPanel();
     }
     if (strpos($this->layout, '{export}') > 0) {
         $this->layout = strtr($this->layout, ['{export}' => $this->renderExport(), '{toolbar}' => $this->toolbar]);
     } else {
         $this->layout = strtr($this->layout, ['{toolbar}' => $this->toolbar]);
     }
     $this->layout = str_replace('{items}', Html::tag('div', '{items}', $this->containerOptions), $this->layout);
     $this->renderPjax();
     parent::run();
     if ($this->pjax) {
         echo ArrayHelper::getValue($this->pjaxSettings, 'afterGrid', '');
         Pjax::end();
     }
 }
示例#25
0
 /**
  * Runs the widget.
  */
 public function run()
 {
     $id = $this->options['id'];
     $options = Json::htmlEncode($this->getClientOptions());
     $view = $this->getView();
     EditableTreeGridViewAsset::register($view);
     $view->registerJs("jQuery('#{$id} .tree').treegrid();");
     $view->registerJs("\$.fn.editable.defaults.mode = 'inline';");
     $view->registerJs("\$('#{$id} .editable').editable({$options});");
     parent::run();
 }