EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: officecode on March 07, 2019, 03:27:54 AM



Title: When loading other pages used to generate dialogs, the layout is messed up
Post by: officecode on March 07, 2019, 03:27:54 AM
Hello, everyone.
I have two page files:
"test1.html" is used to generate a dialog with the following code:

Code:

<body>
<div id="cs"></div>
<script>
$(function(){
$('#cs').dialog({
title:'my title',
width:200,
height:200,
content:'test'
})
})
</script>
</body>


"test2.html" is used to generate the layout. When clicking the button, I want to call the dialog in "test1.html". code show as below:

Code:

<body class="easyui-layout">
<div region="north" style="height: 60px">
<div id="bt" class="easyui-linkbutton" onclick="$('#dlg').load('test1.html')">button</div>
</div>
<div region="west" width=180 title="menu"></div>
<div id="dlg"></div>
</body>


The problem is that when the button is clicked, although the dialog box is displayed, the layout of the layout is messed up.
Please help, thank you very much!


Title: Re: When loading other pages used to generate dialogs, the layout is messed up
Post by: jarry on March 07, 2019, 07:24:06 AM
The layout must have a 'center' region panel. Please put it on your layout component.


Title: Re: When loading other pages used to generate dialogs, the layout is messed up
Post by: officecode on March 07, 2019, 08:35:22 AM
After adding "center", the same problem still occurs:
Code:
<body class="easyui-layout">
<div region="north" style="height: 60px">
<div id="bt" class="easyui-linkbutton" onclick="$('#dlg').load('test1.html')">button</div>
</div>
<div region="west" width=180 title="menu"></div>
<div region="center" title="content"></div>
<div id="dlg"></div>
</body>




Title: Re: When loading other pages used to generate dialogs, the layout is messed up
Post by: jarry on March 07, 2019, 07:05:52 PM
Please look at this example https://www.jeasyui.com/demo/test/test5.html


Title: Re: When loading other pages used to generate dialogs, the layout is messed up
Post by: officecode on March 07, 2019, 10:31:26 PM
Understand that it is only necessary to load the body part of the page.
Thanks.