在JQuery Mobile 1.3.1上,我使用$.mobile.changePage
将外部视图加载到dom中,并使用我认为是将视图作为对话框加载的正确选项。我的问题是这个视图加载,一切都增强但我丢失了对话框上的圆角。按钮具有正确的角,它只是对话框的边缘。当我检查对话框时,看起来它在div上正确地具有ui-corner-all类,但我想它没有被增强?有什么想法吗?
function OpenRestoreFromBackupDialog()
{
if(selectedDeviceIDArray.length == 1){
$.mobile.changePage( "../Mobile/Device/RestoreFromBackup", {
transition: "pop",
role: "dialog",
//reloadPage: true,
data:
{
deviceID: selectedDeviceIDArray[0],
}
});
}
}
在这里加载外部页面(MVC局部视图)......
<div data-role="dialog" id="RestoreFromBackup" data-theme="c">
<form id="RestoreFromBackupForm" action="../Device/RestoreFromBackup" method="post">
<div data-role="header" data-close-btn="left" data-theme="c">
<h1>Restore from Backup</h1>
</div>
<div data-role="content" data-theme="c">
content!
</div>
<div data-role="footer" data-theme="c" style="padding: 10px;">
<a href="#" data-role="button" data-inline="true" data-theme="e" onclick="RestoreFromBackup();">Restore from Backup</a>
<a href="#" data-role="button" data-rel="back" data-inline="true" data-theme="c">Cancel</a>
</div>
</form>
</div>
答案 0 :(得分:2)
答案 1 :(得分:2)
工作示例:http://jsfiddle.net/Gajotres/42DhH/
<div data-role="page" id="index">
<div data-theme="b" data-role="header">
<h1>Index page</h1>
</div>
<div data-role="content">
<a data-role="button" id="click-me">Click me</a>
</div>
</div>
<div data-role="dialog" id="RestoreFromBackup" data-theme="c" >
<div data-role="header" data-close-btn="left" data-theme="c">
<h1>Restore from Backup</h1>
</div>
<div data-role="content" data-theme="c">
<form id="RestoreFromBackupForm" action="../Device/RestoreFromBackup" method="post" class="ui-btn-corner-all">
content!
</form>
</div>
<div data-role="footer" data-theme="c" style="padding: 10px;">
<a href="#" data-role="button" data-inline="true" data-theme="e" onclick="RestoreFromBackup();">Restore from Backup</a>
<a href="#" data-role="button" data-rel="back" data-inline="true" data-theme="c">Cancel</a>
</div>
</div>
由于表单位置不正确,导致您的问题。表单应该在data-role =“content”div中。基本上data-role =“page”应该只有5种内部元素:data-role =“content”,data-role =“header”,data-role =“footer”,data-role =“dialog”,data -role = “弹出”