jQuery mobile cannot refresh the collapsibleset

admin

Administrator
Staff member
I am creating an application using jQuery mobile and loading its menu and pages form wordpress throw jsonp.
I am loding its menu in the form of collapsibleset and listview but i keep on getting errors.
when I try to refresh the collapsibleset by this code

Code:
$(".childnev").html(list);
$.mobile.loading( 'hide');
$('.popupmenu').slideToggle('slow');

$(".childnev").collapsibleset('refresh');

$(".childsublist").listview().listview('refresh');

It gives me this error

Code:
Error: cannot call methods on collapsibleset prior to initialization;
attempted to call method 'refresh'

And when i try to refresh by this code.

Code:
$(".childnev").html(list);
$.mobile.loading( 'hide');
$('.popupmenu').slideToggle('slow');

$(".childnev").collapsibleset();
$(".childnev").collapsibleset('refresh');

$(".childsublist").listview().listview('refresh');

It again gives me this error

Code:
TypeError: o[0] is undefined

Am I missing something or doing something wrong?