[CLOSED] How to change the incrementValue for SpinnerField by javascript

  1. #1

    [CLOSED] How to change the incrementValue for SpinnerField by javascript

    Hi:

    When I load the page, I initial the incrementValue of SpinnerField to 1. I need to change the value depends on user click the cell in GirdPanel. Just want to know could I change the value by Javascript? Thank you very much
    Last edited by Daniil; Mar 21, 2011 at 7:17 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Just
    SpinnerField1.incrementValue = 5;
  3. #3
    That's very simple solution. Thank you.

    Another question is how could I change the value of allowDecimals. I change it by

    SpinnerField1.allowDecimals= true;
    but it doesn't work. Even the value change, in the UI, I still can only input interger value.
  4. #4
    Yes, it's not an option.

    Well, there is no method to change .allowDecimals on the fly.

    I looked on the sources and can suggest the following thing. But I'm not sure it will work in all cases.

    Example
    var changeAllowed = function (field) {
         var allowed = field.baseChars + '';
            if (field.allowDecimals) {
                allowed += field.decimalSeparator;
            }
            if (field.allowNegative) {
                allowed += '-';
            }
            allowed = Ext.escapeRe(allowed);
            field.maskRe = new RegExp('[' + allowed + ']');
            if (field.autoStripChars) {
                field.stripCharsRe = new RegExp('[^' + allowed + ']', 'gi');
            }
    }
    
    SpinnerField1.allowDecimals = true;
    changeAllowed(SpinnerField1);
  5. #5
    It works for me. Thank you very much!

Similar Threads

  1. Replies: 1
    Last Post: Apr 06, 2011, 12:32 PM
  2. [CLOSED] SpinnerField and change/spin listener
    By bakardi in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Feb 10, 2011, 7:57 PM
  3. Change TaskManager Interval using JavaScript
    By Manoj Kumar P in forum 1.x Help
    Replies: 5
    Last Post: Feb 10, 2011, 7:46 AM
  4. [CLOSED] change bodyStyle on panel in Javascript
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 03, 2009, 6:51 AM
  5. [CLOSED] Change icon on treenode from javascript
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 24, 2009, 3:40 PM

Tags for this Thread

Posting Permissions