2017 © Pedro Peláez
 

library yii2-nouislider

Yii2 noUiSlider Wrapper

image

ruskid/yii2-nouislider

Yii2 noUiSlider Wrapper

  • Thursday, September 14, 2017
  • by ruskid
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3,779 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 8 % Grown

The README.md

Yii2 noUiSlider Wrapper.

Installation

The preferred way to install this extension is through http://getcomposer.org/download/., (*1)

Either run, (*2)

php composer.phar require ruskid/yii2-nouislider "dev-master"

or add, (*3)

"ruskid/yii2-nouislider": "dev-master"

to the require section of your composer.json file., (*4)

Usage

  • Check http://refreshless.com/nouislider/ for options.
  • Check https://refreshless.com/nouislider/events-callbacks/ for events.

Main Slider

Can be configured the way you want. This slider is very simple it doesn't do anything special. You need to define your own event handlers if you want to update the hidden input's value on change, slide or update etc., (*5)


use ruskid\nouislider\Slider; echo $form->field($model, 'price')->widget(Slider::className(), [ 'pluginOptions' => [ 'start' => [20], 'connect' => false, 'range' => [ 'min' => 0, 'max' => 100 ] ] ]); echo Slider::widget([ 'name' => 'test', 'value' => 50, 'events' => [ Slider::NOUI_EVENT_CHANGE => new \yii\web\JsExpression('function( values, handle ) {' . ' alert("changed"); }'), Slider::NOUI_EVENT_START => new \yii\web\JsExpression('function( values, handle ) {' . ' alert("start sliding"); }'), Slider::NOUI_EVENT_END => new \yii\web\JsExpression('function( values, handle ) {' . ' alert("end sliding"); }'), Slider::NOUI_EVENT_UPDATE => new \yii\web\JsExpression('function( values, handle ) {' . ' alert("updated"); }'), Slider::NOUI_EVENT_SET => new \yii\web\JsExpression('function( values, handle ) {' . ' alert("set"); }'), Slider::NOUI_EVENT_SLIDE => new \yii\web\JsExpression('function( values, handle ) {' . ' alert("slided"); }'), ], 'pluginOptions' => [ 'start' => [20], 'connect' => false, 'range' => [ 'min' => 0, 'max' => 100 ] ] ]);

Sliders with default behavior

You can use some of the sliders inside sliders directory and create your own. Extend Main Slider., (*6)

Pull request your sliders!, (*7)


echo $form->field($model, 'price_min')->widget(OneHandleSlider::className(), [ 'valueContainerId' => 'price_min-container', 'pluginOptions' => [ 'start' => [20], 'connect' => false, 'range' => [ 'min' => 0, 'max' => 100 ] ] ]); echo $form->field($model, 'price_max')->widget(OneHandleSlider::className(), [ 'valueContainerId' => 'price_max-container', 'pluginOptions' => [ 'start' => [20], 'connect' => false, 'range' => [ 'min' => 0, 'max' => 100 ] ] ]);
Price min:
Price max:
echo $form->field($model, 'price')->widget(TwoHandleSlider::className(), [ 'lowerValueContainerId' => 'price_min-container', 'upperValueContainerId' => 'price_max-container', 'pluginOptions' => [ 'start' => [20, 50], 'connect' => false, 'range' => [ 'min' => 0, 'max' => 100 ] ] ]);

The Versions

14/09 2017

dev-master

9999999-dev https://github.com/ruskid/yii2-nouislider

Yii2 noUiSlider Wrapper

  Sources   Download

GNU

The Requires

 

by Victor Demin

yii2 nouislider

07/08 2017

3.1

3.1.0.0 https://github.com/ruskid/yii2-nouislider

Yii2 noUiSlider Wrapper

  Sources   Download

GNU

The Requires

 

by Victor Demin

yii2 nouislider

07/08 2017

3.0

3.0.0.0 https://github.com/ruskid/yii2-nouislider

Yii2 noUiSlider Wrapper

  Sources   Download

GNU

The Requires

 

by Victor Demin

yii2 nouislider

04/08 2017

2.0

2.0.0.0 https://github.com/ruskid/yii2-nouislider

Yii2 noUiSlider Wrapper

  Sources   Download

GNU

The Requires

 

by Victor Demin

yii2 nouislider

15/05 2016

1.0

1.0.0.0 https://github.com/ruskid/yii2-nouislider

Yii2 noUiSlider Wrapper

  Sources   Download

GNU

The Requires

 

by Victor Demin

yii2 nouislider