protected function registerClient()
    {
        $view = $this->getView();
        TreeViewAsset::register($view);

        $selector = ArrayHelper::remove($this->clientOptions, 'selector', 'ol.sortable');
        $view->registerJs("ns = $('{$selector}').nestedSortable(" . Json::htmlEncode($this->clientOptions) . ");");

        $treeView = $this->options['id'];
        $loading = $this->loadingOptions['id'];
        $view->registerJs(<<<JS
treeView = $('#{$treeView}');
loading = $('#{$loading}');
JS
        );
    }