Ejemplo n.º 1
1
 public function init()
 {
     parent::init();
     $this->options['class'] .= ' row component component-resource-list';
     $this->itemOptions['tag'] = false;
     $this->summary = false;
 }
Ejemplo n.º 2
0
 public function init()
 {
     parent::init();
     $LatLngCenter = new LatLng(['lat' => $this->centerPoint['lat'], 'lng' => $this->centerPoint['lng']]);
     $this->map = new Map(['zoom' => $this->zoom, 'center' => $LatLngCenter, 'width' => '100%']);
     $this->initMarkers();
     $this->pushMarkers();
     $this->flushMap();
 }
Ejemplo n.º 3
0
 public function init()
 {
     parent::init();
     foreach (['url', 'srcNode'] as $property) {
         if ($this->pluginOptions[$property] === null) {
             throw new InvalidConfigException("The \"{$property}\" property must be set to \"pluginOptions\".");
         }
     }
     Html::addCssStyle($this->itemOptions, ['display' => 'none']);
 }
Ejemplo n.º 4
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // 信息记录一般从尾页开始显示
     $pagination = $this->dataProvider->getPagination();
     $params = $pagination->params !== null ? $pagination->params : Yii::$app->getRequest()->getQueryParams();
     if (!(isset($params[$pagination->pageParam]) && is_scalar($params[$pagination->pageParam]))) {
         $pageSize = $pagination->getPageSize();
         $totalCount = $this->dataProvider->getTotalCount();
         $pagination->setPage((int) (($totalCount + $pageSize - 1) / $pageSize) - 1);
     }
 }
 public function init()
 {
     parent::init();
     $id = $this->getId();
     $this->options['id'] = $id;
     $classes = isset($this->options['class']) ? $this->options['class'] : '';
     $classes .= ' sortable';
     $this->options['class'] = trim($classes);
     $view = $this->getView();
     JuiAsset::register($view);
     $url = Url::toRoute($this->orderUrl);
     $sortOpts = array_merge($this->sortOptions, ['axis' => 'y', 'items' => '[data-key]', 'update' => new JsExpression("function(e, ui) {\n                jQuery('#{$this->id}').addClass('sorting');\n                jQuery.ajax({\n                    type: 'POST',\n                    url: '{$url}',\n                    data: {\n                        key: ui.item.data('key'),\n                        pos: ui.item.index('[data-key]')\n                    },\n                    complete: function() {\n                        jQuery('#{$this->id}').removeClass('sorting');\n                    }\n                });\n            }")]);
     $sortJson = Json::encode($sortOpts);
     $view->registerJs("jQuery('#{$id}').sortable({$sortJson});");
 }
 public function init()
 {
     parent::init();
     $id = $this->getId();
     if (isset($this->itemOptions['class'])) {
         $this->itemOptions['class'] .= ' item';
     } else {
         $this->itemOptions['class'] = 'item';
     }
     if (isset($this->options['class'])) {
         $this->options['class'] .= ' scroll-block-view clearfix';
     } else {
         $this->options['class'] = 'scroll-block-view clearfix';
     }
     if (!isset($this->options['id'])) {
         $this->options['id'] = $id;
     }
     $this->wallOptions['container'] = new JsExpression("\$('#{$id}')");
     if ($this->columns) {
         $wallOptions['itemwidth'] = 100 / $this->columns . '%';
     }
 }
Ejemplo n.º 7
0
 /**
  * Inits widget
  */
 public function init()
 {
     parent::init();
     $this->initSortable();
 }
Ejemplo n.º 8
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->_date = null;
     $this->layout = "{items}\n{pager}";
 }
Ejemplo n.º 9
0
 public function init()
 {
     parent::init();
     $this->pager['class'] = LinkPager::className();
 }
Ejemplo n.º 10
0
 public function init()
 {
     parent::init();
     $this->initDefaultButtons();
 }
Ejemplo n.º 11
0
 public function init()
 {
     parent::init();
     $this->registerTranslations();
     $this->initOptions();
 }
Ejemplo n.º 12
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->initOptions();
 }
Ejemplo n.º 13
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->_handler = new Intercooler($this->intercooler);
     $this->initListOptions();
 }