Features are: - Display an extended summary of the records shown. The extended summary can be configured to any of the {@link TbOperation} type of widgets. - Automatic chart display (using TbHighCharts widget), where user can 'switch' between views. - Selectable cells - Sortable rows
Наследование: extends TbGridView
 public function renderTableHeader()
 {
     echo CHtml::openTag('caption');
     $this->headText();
     $this->headPageSize();
     $this->headEnableAjax();
     echo CHtml::closeTag('caption');
     parent::renderTableHeader();
 }
Пример #2
0
 public function init()
 {
     if ($this->templateWidget) {
         $class = isset($this->templateWidget['class']) ? $this->templateWidget['class'] : '\\app\\widgets\\BaseGridViewTemplate';
         $params = isset($this->templateWidget['params']) ? $this->templateWidget['params'] : array();
         $this->template = $this->getController()->widget($class, $params, true);
     }
     parent::init();
 }
 public function renderContent()
 {
     if ($this->enablePageSizeDropdown) {
         if (!isset($this->summaryText)) {
             $this->summaryText = 'Displaying {start}-{end} of {count} result(s).';
         }
         $this->summaryText .= $this->renderPageSizeDropdown();
     }
     parent::renderContent();
 }
Пример #4
0
 /**
  * Widget initialization
  *
  * @return void
  */
 public function init()
 {
     $this->_modelName = $this->dataProvider->modelClass;
     $this->headlinePosition = empty($this->headlinePosition) ? self::HP_RIGHT : $this->headlinePosition;
     $this->initPageSizes();
     /*
     $this->ajaxUrl = empty($this->ajaxUrl)
                 ? (array) Yii::app()->controller->action->id
                 : $this->ajaxUrl;
     */
     parent::init();
     // live hack before yii 1.1.15 release:
     strtolower($this->ajaxType) != 'post' || ($this->beforeAjaxUpdate = 'function(id, options) {
         options.data = $.extend(options.data, ' . json_encode(array(Yii::app()->getRequest()->csrfTokenName => Yii::app()->getRequest()->csrfToken)) . ');
     }');
 }
Пример #5
0
 /**
  * @throws \CException
  */
 public function registerCustomClientScript()
 {
     parent::registerCustomClientScript();
     if ($this->sortableRows) {
         $mainAssets = Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('application.modules.yupe.views.assets'));
         Yii::app()->getClientScript()->registerScriptFile($mainAssets . '/js/custom-grid-sortable.js', CClientScript::POS_END);
     }
 }
Пример #6
0
 /**
  * Widget initialization
  *
  * @return void
  */
 public function init()
 {
     $this->_modelName = $this->dataProvider->modelClass;
     $this->headlinePosition = empty($this->headlinePosition) ? self::HP_RIGHT : $this->headlinePosition;
     $this->initPageSizes();
     $this->ajaxUrl = empty($this->ajaxUrl) ? (array) Yii::app()->controller->action->id : $this->ajaxUrl;
     $this->bulkActions = empty($this->bulkActions) ? array('actionButtons' => array(array('id' => 'delete-post', 'buttonType' => 'button', 'type' => 'danger', 'size' => 'small', 'label' => Yii::t('YupeModule.yupe', 'Delete'), 'click' => 'js:function(values){ if(!confirm("' . Yii::t('YupeModule.yupe', 'Do you really want to delete selected elements?') . '")) return false; multiaction("delete", values); }')), 'checkBoxColumnConfig' => array('name' => 'id')) : $this->bulkActions;
     $this->type = empty($this->type) ? 'striped condensed' : $this->type;
     $this->bulkActionAlign = 'left';
     // live hack before yii 1.1.15 release:
     strtolower($this->ajaxType) != 'post' || ($this->beforeAjaxUpdate = 'function(id, options) {
         options.data = $.extend(options.data, ' . json_encode(array(Yii::app()->getRequest()->csrfTokenName => Yii::app()->getRequest()->csrfToken)) . ');
     }');
     parent::init();
 }
Пример #7
0
 /**
  * Widget initialization
  *
  * @return void
  */
 public function init()
 {
     $this->_modelName = $this->dataProvider->modelClass;
     $this->uid = uniqid($this->_modelName);
     $this->headlinePosition = empty($this->headlinePosition) ? self::HP_RIGHT : $this->headlinePosition;
     $this->initPageSizes();
     $this->ajaxUrl = empty($this->ajaxUrl) ? (array) Yii::app()->getController()->getAction()->getId() : $this->ajaxUrl;
     $this->bulkActions = empty($this->bulkActions) ? ['class' => 'booster.widgets.TbBulkActions', 'align' => 'right', 'actionButtons' => [['id' => 'delete-' . strtolower($this->_modelName), 'buttonType' => 'button', 'context' => 'danger', 'size' => 'small', 'label' => Yii::t('YupeModule.yupe', 'Delete'), 'click' => 'js:function (values) { if(!confirm("' . Yii::t('YupeModule.yupe', 'Do you really want to delete selected elements?') . '")) return false; multiaction' . $this->uid . '("delete", values); }']], 'checkBoxColumnConfig' => ['name' => 'id']] : $this->bulkActions;
     $this->type = empty($this->type) ? 'striped condensed' : $this->type;
     $this->bulkActionAlign = 'left';
     parent::init();
     $this->reinstallDatePickers();
 }