public function registerAssets()
 {
     $view = $this->getView();
     if (is_null($this->positionScript)) {
         $this->positionScript = $view::POS_LOAD;
     }
     if (is_array($this->events) && !empty($this->events)) {
         $this->registerEvents();
     }
     $bandle = w2uiAsset::register($view);
     $settings = Json::encode($this->settings);
     $selector = "#{$this->options['id']}";
     $view->registerJs("jQuery('{$selector}').w2toolbar({$settings});", $this->positionScript);
 }
 public function registerAssets()
 {
     $view = $this->getView();
     if (is_array($this->events) && !empty($this->events)) {
         $this->registerEvents();
     }
     $bandle = w2uiAsset::register($view);
     if ($this->locale && file_exists("{$bandle->basePath}/locale/{$this->locale}.json")) {
         $view->registerJs("w2utils.locale('{$bandle->baseUrl}/locale/{$this->locale}.json');");
     }
     $settings = Json::htmlEncode($this->settings);
     $selector = "#{$this->options['id']}";
     $view->registerJs("jQuery('{$selector}').w2layout({$settings});");
 }