{"action":"opened","issue":{"url":"https://api.github.com/repos/jtsage/jquery-mobile-spinbox/issues/16","labels_url":"https://api.github.com/repos/jtsage/jquery-mobile-spinbox/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/jtsage/jquery-mobile-spinbox/issues/16/comments","events_url":"https://api.github.com/repos/jtsage/jquery-mobile-spinbox/issues/16/events","html_url":"https://github.com/jtsage/jquery-mobile-spinbox/issues/16","id":118284411,"number":16,"title":"How can I change min/max value dynamically?","user":{"login":"ka2yam","id":12929663,"avatar_url":"https://avatars.githubusercontent.com/u/12929663?v=3","gravatar_id":"","url":"https://api.github.com/users/ka2yam","html_url":"https://github.com/ka2yam","followers_url":"https://api.github.com/users/ka2yam/followers","following_url":"https://api.github.com/users/ka2yam/following{/other_user}","gists_url":"https://api.github.com/users/ka2yam/gists{/gist_id}","starred_url":"https://api.github.com/users/ka2yam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ka2yam/subscriptions","organizations_url":"https://api.github.com/users/ka2yam/orgs","repos_url":"https://api.github.com/users/ka2yam/repos","events_url":"https://api.github.com/users/ka2yam/events{/privacy}","received_events_url":"https://api.github.com/users/ka2yam/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-22T19:51:07Z","updated_at":"2015-11-22T19:51:07Z","closed_at":null,"body":"var spinbox=\"<div class='ui-field-contain'><label for=\" + id + \"></label><input type='text' data-role='spinbox' id=\" + id + \" data-options='{\\\"type\\\":\\\"vertical\\\"}' value='60' min='0' max='100' /></div>\";\r\n\r\n$(target).append(spinbox);\r\n\r\nThen change min/max/value in other function as below since I would like to change min/max value depends on user's selection.\r\n\r\n    $('#' + id).spinbox({\"dmax\": max});\r\n    $('#' + id).spinbox({\"dmin\": min});\r\n    $('#' + id).val(val);\r\n    $('#' + id).text(\"refresh\");\r\n\r\nBut UI(+,-) button layout seems something wrong.\r\nWhen use following function to change max/min value, UI's becomes normal.\r\n\r\n   $('#' + id).attr(\"min\", min);\r\n   $('#' + id).attr(\"max\", max);\r\n\r\nHowever above min/max value is not read after create function. So it does not work correctly.\r\n\r\nAs temporary solution, I've modified jqm-spinbox.js as below to read min/max value from attribution when user press spinbox.\r\n\r\n_offset: function( obj, direction ) {\r\n\tvar tmp,\r\n\tw = this,\r\n\to = this.options;\t\t\t\t\r\n\tif ( !w.disabled ) {\r\n              o.dmin = ( typeof w.d.input.attr('min') !== 'undefined' ) ? parseInt(w.d.input.attr('min'),10) : Number.MAX_VALUE * -1;   <-- Adding\r\n\t      o.dmax = ( typeof w.d.input.attr('max') !== 'undefined' ) ? parseInt(w.d.input.attr('max'),10) : Number.MAX_VALUE; <-- Adding\r\n\r\nHow can I set min/max value correctly? \r\n\r\nThanks\r\n\r\n"}}