Results 1 to 2 of 2

Thread: Spinnerfield don't fire the Change Event

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Sep 2011
    Maddaloni (CE) Italy
    Vote Rating

    Default Spinnerfield don't fire the Change Event

    I'm tried and I follow the post ......

    I commented //Onblur:Empty
    and the last line of triggerOnBlur like suggested by post ....
    but don't change nothing

    on blur and on change doesn't fire ...

    Please suggest me how do correct the Bug

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    Try this override:

    Ext.override(Ext.ux.form.SpinnerField, {
        setRawValue: function(val) {
            var me  = this,
                old = me.getValue(),
            if (me.fireEvent('beforechange', me, val, old) == false) {
            ret = me.rendered ? (me.el.dom.value = (Ext.isEmpty(val) ? '' : val)) : '';
            me.fireEvent('change', me, val, old);
            return ret;
    I gave you two events, beforechange and change. If you return false in the beforechange, it will cancel the changing:

        var form = new Ext.form.FormPanel({
            renderTo : Ext.getBody(),
            width    : 400,
            height   : 400,
            title    : 'Test',
            items    : [
                    xtype      : 'spinnerfield',
                    fieldLabel : 'Spinner',
                    listeners  : {
                        beforechange : function(field, newValue, oldValue) {
                            return newValue <= 5 && newValue >= -5;
                        change : function(field, newValue, oldValue) {
                            console.log(newValue, oldValue);
    You can see in the beforechange listener it return true if newValue is less than or equal to 5 and greater than or equal to -5. If it attempts to change outside +/-5 it will return false and stop it. You can also see in the change listener you have access to the field, new and old values.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2

    Think my support is good? Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts