EasyUI Forum
December 08, 2025, 08:31:31 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: number-spinner cannot set default  (Read 16071 times)
devnull
Sr. Member
****
Posts: 431


View Profile
« on: October 16, 2012, 02:36:49 AM »

I cannot get the default value of 1 to appear:

This won't work
Code:
<input name="test_1" class="easyui-numberspinner" data-options="min:0,max:3,editable:false" value="1">

Neither will this:
Code:
<input name="test_1" class="easyui-numberspinner" data-options="value:1,min:0,max:3,editable:false">
Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 16, 2012, 03:23:18 AM »

They all work fine. Please refer to this sample.
http://jsfiddle.net/asSv7/
Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #2 on: October 16, 2012, 04:19:46 AM »

My apologies, there seems to be some other code which is interfering with it, I am still investigating what that is.

Thanks
Logged

-- Licensed User --
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #3 on: October 16, 2012, 04:44:53 AM »

OK, I discovered the problem, because the default is set as the input "value" attribute, when you clear the form form('clear') the value also gets cleared and so the field is then null.

I also noticed that this happens with other fields such as the combobox.

Can this be changed so that when a form is cleared, the combo box, number spinner etc default to their default values and not null ? - or add anew method reset() which sets all controls on the form to their default state / values ??

Thanks
Logged

-- Licensed User --
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!