Error: cannot call methods on spinner prior to initialization; attempted to call method 'disableWithoutRemovingValue'

北城余情 提交于 2020-02-24 03:41:27

问题


I tried to use the ui.spinner.js plugin, and in document ready i initialize some textbox to be a disabled spinner like this:

$('#id').spinner("disableWithoutRemovingValue");

In this case is have this error : Error: cannot call methods on spinner prior to initialization; attempted to call method 'disableWithoutRemovingValue'. Also, i tried to change disableWithoutRemovingValue by using option but still i have the same error. So, is there any one help me to fix this error?


回答1:


I've been stuck with same trouble and I've found the workaround is resolving that:

$(document).on('pagebeforeshow', function () {
    $('#id').spinner("disableWithoutRemovingValue");
});



来源:https://stackoverflow.com/questions/29968126/error-cannot-call-methods-on-spinner-prior-to-initialization-attempted-to-call

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!