问题
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