Presenting the spinner control for extjs 2.0.
Made some small changes on the 1.1.x version to make it work with ExtJS 2.0
Make sure to remove the Spinner from ExtJS v1.1 as it conflicts with the one for ExtJS v2.0
demo: http://members.upc.nl/j.chim/ext/spi...t-spinner.html
Usage:
Create a new Spinner control with number spinning as default:
New spinner. Initial value 10; Set it to a number spinner with min- and max value and custom increments.Code:var spinner = new Ext.ux.form.Spinner(); spinner.applyToMarkup('existingInputText');New spinner. Set spinner to a time spinner.Code:var spinner = new Ext.ux.form.Spinner({ value: 10, strategy: new Ext.ux.form.Spinner.NumberStrategy({minValue:0, maxValue:100, incrementValue:5, alternateIncrementValue:10}) }); spinner.applyToMarkup('existingInputText');
New spinner. Set spinner to a date spinner with custom date format.Code:var spinner = new Ext.ux.form.Spinner({ strategy: new Ext.ux.form.Spinner.TimeStrategy() }); spinner.applyToMarkup('existingInputText');
See this page for more formats. Applies to TimeSpinner too.
As of version 0.3 it's possible to pass strategy config in constructor. See post.Code:var spinner = new Ext.ux.form.Spinner({ strategy: new Ext.ux.form.Spinner.DateStrategy({format:'Y-m-d'}) }); spinner.applyToMarkup('existingInputText');
supported 'xtype': [number, date, time]
Updates:Code:var spinner = new Ext.ux.form.Spinner({ strategy:{ xtype:'number' ,minValue:0 ,maxValue:100 } ,name:'mySpinner' // ... });
-- 2008-08-27 (v0.35) --
[changed] - disable scrolling when field is not focused, preventing accidental scrolling
[added] - validation-call after spinning, with small delay (buffered)
[fixed] - double spinning bug. thanks vtswingkid! [post]
[fixed] - spinner still working when disabled
[added] - generic spin event, for spinning up and down
-- 2008-05-08 (v0.3) --
[added] - new event 'spin', which fires after spinning up or down
[fixed] - prevent pagescroll upon pageup/down event in Opera
[fixed] - invalid date/time formatting. patch by almostchristian's. [post]
[added] - jsakalos patch, enabling passing strategy config in constructor. [post]
[fixed] - Spinning while Spinner is set to readOnly or disabled
[added] - Releasing plugin under BSD-license
-- 2008-01-10 (v0.21) --
[fixed] - Minor changes to SpinnerStrategy.js to make it work with the SpinnerPlugin
-- 2008-01-04 (v0.2) --
[fixed] - spinning twice onclick
[added] - registered xtype: "uxspinner"
[added] - precision attributes for numberstrategy (allowDecimals & decimalPrecision)
Ideas
- smartspin option for number- and date strategy
Reply With Quote


