halilu
Posts: 0
Joined: Mon Nov 04, 2013 8:53 pm

cannot call methods on checkboxradio prior to initialization; attempted to call method 'refresh'

Good day

Title is the error I get when trying to update checkboxes on the success event of a service. The service is called on the load event

I would think the checkbox has been initialized at this point.

Code is

var setChannelsFromResponse = function (response) {
var channs = response.channels;

Code: Select all

 for (i = 0; i < channs.length; i++) { 

         Apperyio("mcb" + channs[i].toString()).attr("checked", true).checkboxradio("refresh"); 

 } 

}

I've tried various things including

using timeouts
using the init event.

No luck

I also see this has popped up before, but was unsolved

https://getsatisfaction.com/apperyio/...

Any ideas please? I feel like I'm clearly missing something here.

Thanks

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

cannot call methods on checkboxradio prior to initialization; attempted to call method 'refresh'

And, you don't put it in the page show method because ?

halilu
Posts: 0
Joined: Mon Nov 04, 2013 8:53 pm

cannot call methods on checkboxradio prior to initialization; attempted to call method 'refresh'

I had tried that, thanks. Same problem

But why should I be using the page show for this? I need it to load just the once. I would assume the checbox state would saved once it's been updated, no?

Page show would be needlessly more expensive. As it would have to call the service each time the page is shown, and not just on page load (which is less frequent).

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

cannot call methods on checkboxradio prior to initialization; attempted to call method 'refresh'

Hello,

Please use a JS below for that:
pre$("[name=myCheckbox] input")&#46;attr("checked", true)&#46;checkboxradio("refresh");/pre
here myCheckbox - name of the checkbox

halilu
Posts: 0
Joined: Mon Nov 04, 2013 8:53 pm

cannot call methods on checkboxradio prior to initialization; attempted to call method 'refresh'

Thanks man!

Guess I need work on my jquery-fu....

And learn when to use selectors (and how to use them properly) as opposed to using apperyio....

Return to “Issues”