protected function renderButtonSpoiler()
    {
        $options = ArrayHelper::merge([
            'role' => 'button',
            'data-spoiler-group' => 'main',
            'data-spoiler-toggle' => true,
            'data-target' => $this->button['id'] . '-body',
        ], $this->button);

        $label = $this->getButtonLabel(ArrayHelper::remove($options, 'label'));

        $this->parts['{button}'] = Html::tag(ArrayHelper::remove($options, 'tag'), $label, $options);
        $this->getView()->registerJs("
             $('[data-spoiler-toggle]').click(function (e) {
                $('#'+$(this).data('target')).toggle();
                $('[data-spoiler-group=\"{$options['data-spoiler-group']}\"]').not($(this)).trigger('hide');
             }).on('hide', function () {
                $('#'+$(this).data('target')).hide();
             })",
            View::POS_READY);
    }