[Dojo-interest] dijit.form.NumberSpinner defaultValue

Stephen Ince stephenpince at gmail.com
Wed Jun 16 15:08:59 EDT 2010


Rob,
   Thx for your reponse. 
   Sorry dojo.byId('test.userLoad').defaultValue does return the default value. I had tried dojo.byId('test.userLoad').value and not dojo.byId('test.userLoad').defaultValue;

Steve
 
  
  ----- Original Message ----- 
  From: Rob Weiss 
  To: dojo-interest at mail.dojotoolkit.org 
  Sent: Wednesday, June 16, 2010 08:30
  Subject: Re: [Dojo-interest] dijit.form.NumberSpinner defaultValue


  Why not just add an attribute to the object?

  dojo.byId('test.userLoad').NumberSpinner.attr("myDefaultValue","1069");

  I do this all the time; mixin what I need.....

  Or extend it, if what you need is not there....

  I use dojo/dijit as my base for creating everything as custom widgets so I can extend and refactor more easily as the needs arise; which for my app is daily!!


  On Wed, Jun 16, 2010 at 8:15 AM, Stephen Ince <stephenpince at gmail.com> wrote:

    Hi,
       Does any one know the api to retrieve the default value for a dijit.form.NumberSpinner?  I need to get back the original form value?

    e.g.
    <input type="text" name="test.userLoad" value="1069" id="test.userLoad" 
              style="width:70px" onchange="setUserLoadNumbers(document.forms['editForm'],true);" 
              dojoType="dijit.form.NumberSpinner" constraints="{min:1}" trim="true"/>

    Get back '1069' and the current Value.

    Normally you can do form['test.userLoad'].defaultValue or dojo.byId('test.userLoad').NumberSpinner. Actually both work for a dijit.form.TextBox but not for a NumberSpinner widget.

    I also tried the following:
    digit.byId('test.userLoad').defaultValue
    and
    digit.byId('test.userLoad').attr('defaultValue');

    Any help would be appreciated.


    Steve


    _______________________________________________
    FAQ: http://dojotoolkit.org/support/faq
    Book: http://docs.dojocampus.org
    Dojo-interest at mail.dojotoolkit.org
    http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest






------------------------------------------------------------------------------


  _______________________________________________
  FAQ: http://dojotoolkit.org/support/faq
  Book: http://docs.dojocampus.org
  Dojo-interest at mail.dojotoolkit.org
  http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-interest/attachments/20100616/79c3aa13/attachment-0001.htm 


More information about the Dojo-interest mailing list