EasyUI Forum
November 04, 2025, 05:26:45 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Trouble with NumberSpinner  (Read 9145 times)
yamilbracho
Jr. Member
**
Posts: 64


View Profile Email
« on: June 03, 2015, 08:45:28 AM »

Hi
I show a dialog with a NumberSpinner field. This spinner I fill with data read from a table in my database. My code is returning the next id available so i want my spinner got this value and set ir as minimum too. My code :

Code:
   var nextIdUrl = 'MyController.php';
        //console.log(nextIdUrl);
        $.get(nextIdUrl, function(response) {
            var jsonResponse = eval('(' + response + ')');
            var nextId = jsonResponse.NextId;
            $('#id_canal').numberspinner({
                min: nextId,
                value:nextId
            });
        });

nextId with a value, say 10, but my spinner does not got this value and I can go back , say 9, 8, ...
I also wrote
            $('#id_canal').numberspinner({
                min: nextId
           });

           $('#id_canal').numberspinner('setValue', nextId) but it did not work either...
 
Any hint,please...
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: June 04, 2015, 01:19:13 AM »

Make sure the 'nextId' value is a number. Try the code instead.
Code:
            var nextId = parseInt(jsonResponse.NextId);
            $('#id_canal').numberspinner({
                min: nextId,
                value:nextId
            });
Logged
yamilbracho
Jr. Member
**
Posts: 64


View Profile Email
« Reply #2 on: June 05, 2015, 07:57:55 AM »

Thanks for your suggestion..
I think the real problem is I defined the field as mandatory :
     <input id='id_canal' name='id_canal' class='easyui-numberspinner'  required="true">
if it take out the required attribute, then works fine using or not parseInt...

is there a special treatment with the required attribute ?

Regards,
Yamil
 
Logged
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!