-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Cannot open dialog with ajax #5717
Comments
I just found out there is no $( selector ).dialog( 'open' )... Wow. In the meanwhile you can give a try using a popup as dialog. http://api.jquerymobile.com/popup/ |
I cannot reproduce this using the latest version (http://jsbin.com/onibuc/340) or using 1.3.0 (http://jsbin.com/onibuc/342). If my jsbins do not reproduce the issue, please correct them and re-open this issue. |
$.mobile.changePage() ... In that case, the documentation ( http://api.jquerymobile.com/dialog/ ) needs an update, saying that this is the way of opening dialogs from JavaScript. I cannot reopen the issue to keep it up until the documentation is updated. :( |
Thanks. |
Blurb added. HTH! |
I have tracked down the error and got jsfiddle example It is when dialog page contains a panel, when it trigger the error: |
This issue is fixed in branch ext-panels, which will be merged for 1.4.0. |
The branch has been merged so I am closing as fixed. Let us know if this is still an issue in the 1.4 alpha release. |
When opening a dialog with JavaScript in single-page template, the dialog fail to open.
How to repeat:
$.mobile.changePage("aPageThatisNotidDom.html", {transition: "pop", role: "dialog"})
Will cause error message: "Uncaught TypeError: Cannot read property 'nodeType' of undefined "
I traced the error and seems that reason for this migh be in line 8014, which is:
page = $el.closest( ":jqmData(role='page')" ),
It cannot find the content for variable "page", because on dialogs which are crawled with ajax, data-role attribute is a "dialog", not a "page".
Tested on Google Chrome 24, jQuery mobile 1.3.0, jQuery 1.9.1
The text was updated successfully, but these errors were encountered: