public function run()
    {
        if (!empty($this->_widgets)) {
            throw new InvalidCallException('Each beginWidget() should have a matching endWidget() call.');
        }
        $id = $this->options['id'];
        $view = $this->getView();
        $options = !empty($this->clientOptions) ? Json::encode($this->clientOptions) : Json::encode([]);
        GridstackAsset::register($view);
        $view->registerJs("jQuery('#$id').gridstack($options);");
        echo self::endContainer($this->tag);
    }