jQuery UI Helpers / Spinner

Introduction

You can create a spinner with the Spinner or SpinnerFor helpers.

@model SpinnerModel
<div class="editor-field">
<label for="price">Price</label>
@Html.JQueryUI().Spinner("price")
</div>
<div class="editor-field">
<label for="Value">Value</label>
@Html.JQueryUI().SpinnerFor(m => m.Value)
</div>

The result is this.

The next example demonstrates the fluent configuration API.

<div>
<label for="value2">Value 2</label>
@(Html.JQueryUI().Spinner("value2").Min(0).Max(100).Step(5))
</div>

This creates the following spinner.

Number Format

Number formatting is partially supported in this version of jQuery UI Helpers. Using the DecimalDigits configuration method you can set the number of decimal digits. The type of the decimal separator is determined either by the current culture or by providing a culture to the Culture method. For client side support you will have to add jQuery Globalize to your page (with all the necesary culture files).

HTML Helpers

Fluent Configuration API