jQuery Mobile Listview in Dialog won't initialize -
i dynamically creating dialog contains listview , appending body
when user navigates specific data-role=page
. after appending dialog body
call
$('#mydialog').dialog(); $('#mylist', '#mydialog').listview();
when call listview()
function following error:
uncaught typeerror: cannot read property 'jquery19105852627926506102' of undefined
the way have been able initialize listview during pageshow
event of dialog, user sees listview items without styling until listview()
function complete.
is there way can initialize listview inside dialog before dialog has been shown?
update: same error if use `$('#mydialog').trigger('create').
dialogs treated same way pages are. when appending page/dialog dynamically dom, dont need call kind of enhancement, initialized, widgets within, prior showing them.
all need append dialog <body>
or $.mobile.pagecontainer
, open dialog using $.mobile.changepage()
.
$.mobile.pagecontainer.append("dialog html markup"); $.mobile.changepage("#dialog_id");
note calling enhancement methods on elements within page isn't created/initialized yet, result error. however, can refresh widgets on visited/initialized pages.
Comments
Post a Comment