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.

demo


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -