Class yii\jui\Spinner
Inheritance | yii\jui\Spinner » yii\jui\InputWidget » yii\jui\Widget » yii\base\Widget |
---|---|
Available since version | 2.0 |
Spinner renders an spinner jQuery UI widget.
For example:
echo Spinner::widget([
'model' => $model,
'attribute' => 'country',
'clientOptions' => ['step' => 2],
]);
The following example will use the name property instead:
echo Spinner::widget([
'name' => 'country',
'clientOptions' => ['step' => 2],
]);
You can also use this widget in an \yii\jui\yii\widgets\ActiveForm using the \yii\jui\yii\widgets\ActiveField::widget() method, for example like this:
<?= $form->field($model, 'from_date')->widget(\yii\jui\Spinner::classname(), [
'clientOptions' => ['step' => 2],
]) ?>
See also http://api.jqueryui.com/spinner/.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$attribute | string | The model attribute that this widget is associated with. | yii\jui\InputWidget |
$clientEvents | array | The event handlers for the underlying jQuery UI widget. | yii\jui\Widget |
$clientOptions | array | The options for the underlying jQuery UI widget. | yii\jui\Widget |
$model | \yii\base\Model | The data model that this widget is associated with. | yii\jui\InputWidget |
$name | string | The input name. | yii\jui\InputWidget |
$options | array | The HTML attributes for the widget container tag. | yii\jui\Widget |
$value | string | The input value. | yii\jui\InputWidget |
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$clientEventMap | array | Event names mapped to what should be specified in `. | yii\jui\Spinner |
Public Methods
Method | Description | Defined By |
---|---|---|
init() | Initializes the widget. | yii\jui\InputWidget |
renderWidget() | Renders the Spinner widget. | yii\jui\Spinner |
run() | Renders the widget. | yii\jui\Spinner |
Protected Methods
Method | Description | Defined By |
---|---|---|
hasModel() | yii\jui\InputWidget | |
registerClientEvents() | Registers a specific jQuery UI widget events | yii\jui\Widget |
registerClientOptions() | Registers a specific jQuery UI widget options | yii\jui\Widget |
registerWidget() | Registers a specific jQuery UI widget asset bundle, initializes it with client options and registers related events | yii\jui\Widget |
Property Details
Event names mapped to what should be specified in .on()
.
If empty, it is assumed that event passed to clientEvents is prefixed with widget name.
protected array $clientEventMap = ['spin' => 'spin', 'change' => 'spinchange', 'create' => 'spincreate', 'start' => 'spinstart', 'stop' => 'spinstop']
Method Details
Renders the Spinner widget.
public string renderWidget ( ) | ||
return | string | The rendering result. |
---|
Renders the widget.
public void run ( ) |