user3706803
user3706803

Reputation: 155

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

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?

Upvotes: 4

Views: 1240

Answers (1)

Jigius
Jigius

Reputation: 315

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

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

Upvotes: 0

Related Questions