Yii2-Slider

This is the forum for the yii2-slider extension for Yii framework 2.0. This is an advanced slider input for Yii Framework 2 based on bootstrap-slider plugin. Allows vertical or horizontal orientation of slider, setup min/max values and step, range selector (multiple handles to control the range), three shapes for handles, touch capablity and support for touch devices and more.

Refer documentation and demos.

Hi Kartik,

I have posted my question at the slider demo page before finding this forum.

Sorry for cross posting here.

The slider has a hidden input field.

Just wondering how to get the bound input field enabled.

The idea is that users could choice to set the field value using the slider or providing the value in the field directly.

Thanks and Regards,

-Charles

You could easily add a text box and trap two change events (of the hidden input and of the displayed input) - to update your use case.

You can also try the RangeInput widget from the yii2-widgets stable, which offers what you need by default (it uses HTML 5 range input). You can update with the slider as well as the input.

Hi Kartik,

I just upgrade from Yii2-beta to Yii2-GA and now when I use a slider in an activeform a strange default value is returned. For example:


<?= $form->field($model, 'price')->widget(Slider::classname(), [

	'name' => 'slider_price',

	'value' => '0',

    'sliderColor' => Slider::TYPE_GREY,

    'handleColor' => Slider::TYPE_INFO,

    'pluginOptions'=>[

        'handle' => 'square',

        'min'=>0,

        'max'=>200000,

        'step'=>500,

        'tooltip'=>'always',

    ],

]); ?>

return the value : 5 ! (when I don’t slide, if I slide the returned value is correct)

is there something like this in Yii1? sorry but i would love to use this widget but i am on Yii 1x