2017 © Pedro Peláez
 

library bootstrap-spinedit

A spin edit control for Twitter Bootstrap.

image

zardo/bootstrap-spinedit

A spin edit control for Twitter Bootstrap.

  • Wednesday, April 9, 2014
  • by zardo
  • Repository
  • 1 Watchers
  • 0 Stars
  • 18 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 50 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Spin Edit for Twitter Bootstrap

Spin Edit Example Spin Edit Example, (*1)

A spin edit control for Twitter Bootstrap., (*2)

Tested with version 2.2.1., (*3)

Demo

Click here for a live demo., (*4)

Usage

This component relies on Twitter Bootstrap and jQuery., (*5)

Basic usage:, (*6)




<link rel="stylesheet" type="text/css" href="bootstrap.css" />
<link rel="stylesheet" type="text/css" href="bootstrap-spinedit.css" />

<input type="text" id="spinEdit" />






You can use the following additional options to modify the behaviour of the spin edit control:, (*7)

  • value: The initial value (default 0).
  • minimum: The minimum allowed value (default 0).
  • maximum: The maximum allowed value (default 100).
  • step: The amount that control uses to increase or decrease its vaule (default 1).
  • numberOfDecimals: The number of allowed decimals (default 0).

For example:, (*8)




<link rel="stylesheet" type="text/css" href="bootstrap.css" />
<link rel="stylesheet" type="text/css" href="bootstrap-spinedit.css" />

<input type="text" id="spinEdit" />






Methods

setValue, (*9)

Set the value of the spin edit., (*10)

$('#spinEdit').spinedit('setValue', 100);

setMinimum, (*11)

Set the minimum allowed value of the spin edit., (*12)

$('#spinEdit').spinedit('setMinimum', -10000);

setMaximum, (*13)

Set the maximum allowed value of the spin edit., (*14)

$('#spinEdit').spinedit('setMaximum', 10000);

setStep, (*15)

Set the step, by which the value of the spin edit is increased / decreased., (*16)

$('#spinEdit').spinedit('setStep', 100);

increase, (*17)

Increase the value of the spin edit with the value defined by its step property., (*18)

$('#spinEdit').spinedit('increase');

decrease, (*19)

Decrease the value of the spin edit with the value defined by its step property., (*20)

$('#spinEdit').spinedit('decrease');

setNumberOfDecimals, (*21)

Sets the number of allowed decimals., (*22)

$('#spinEdit').spinedit('setNumberOfDecimals', 2);

Events

The spin edit supports one event, namely valueChanged. This event is triggered when its value changes., (*23)

The event object has one additional property:, (*24)

  • value: The new value of the spin edit.
$('#spinEdit').on("valueChanged", function (e) {
    console.log(e.value);
});

License

This code is made available under the Apache License v2.0, the same as Twitter Bootstrap., (*25)

The Versions

09/04 2014

dev-master

9999999-dev http://geersch.github.io/bootstrap-spinedit/

A spin edit control for Twitter Bootstrap.

  Sources   Download

Apache 2.0

css bootstrap javascript spin