EasyUI Forum
May 16, 2024, 10:23:28 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Tabs iframe lloading  (Read 10696 times)
xixi
Newbie
*
Posts: 4


View Profile Email
« on: April 04, 2016, 11:38:36 PM »

version 1.4.2-1.4.5

Tabs  iframe lloading
Events onBeforeOpen have a bug

Code:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Nested Tabs - jQuery EasyUI Demo</title>
    <link rel="stylesheet" type="text/css" href="../easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="../easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="../easyui/demo/demo.css">
    <script type="text/javascript" src="../easyui/jquery.min.js"></script>
    <script type="text/javascript" src="../easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#typeList").panel({
                onBeforeOpen: function () {
                    var url = "second.jsp";
                    $("#typeIframe").attr("src", url);
                }
            });
        });
    </script>
</head>
<body>
<h2>Nested Tabs</h2>
<p>The tab panel can contain sub tabs or other components.</p>
<div style="margin:20px 0;"></div>
<div class="easyui-tabs" data-options="tools:'#tab-tools'" style="width:700px;height:250px">
    <div title="Sub Tabs" style="padding:10px;">
        <div class="easyui-tabs" data-options="fit:true,plain:true">
            <div title="Title1" style="padding:10px;">Content 1</div>
            <div title="Title2" style="padding:10px;">Content 2</div>
            <div title="Title3" style="padding:10px;">Content 3</div>
        </div>
    </div>
    <div title="Iframe" id="typeList" data-options="closable:true" style="overflow:hidden">
        <iframe scrolling="yes" id="typeIframe" frameborder="0"   style="width:100%;height:100%;"></iframe>
    </div>
    <div title="DataGrid" data-options="closable:true" style="padding:10px">
        <table class="easyui-datagrid" data-options="fit:true,singleSelect:true,rownumbers:true">
            <thead>
            <tr>
                <th data-options="field:'f1',width:100">Title1</th>
                <th data-options="field:'f2',width:100">Title2</th>
                <th data-options="field:'f3',width:100">Title3</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>d11</td>
                <td>d12</td>
                <td>d13</td>
            </tr>
            <tr>
                <td>d21</td>
                <td>d22</td>
                <td>d23</td>
            </tr>
            </tbody>
        </table>
    </div>
</div>

</body>
</html>
Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #1 on: April 05, 2016, 12:13:21 AM »

If you want to use the 'onBeforeOpen' event on a tab panel, please set it when creating the tab panel.
Code:
<div title="Iframe" id="typeList" style="overflow:hidden" data-options="
closable:true,
onBeforeOpen:function(){
    var url = 'second.jsp';
    $('#typeIframe').attr('src', url);
}">
    <iframe scrolling="yes" id="typeIframe" frameborder="0"   style="width:100%;height:100%;"></iframe>
</div>
Logged
xixi
Newbie
*
Posts: 4


View Profile Email
« Reply #2 on: April 05, 2016, 02:35:08 AM »

If you want to use the 'onBeforeOpen' event on a tab panel, please set it when creating the tab panel.
Code:
<div title="Iframe" id="typeList" style="overflow:hidden" data-options="
closable:true,
onBeforeOpen:function(){
    var url = 'second.jsp';
    $('#typeIframe').attr('src', url);
}">
    <iframe scrolling="yes" id="typeIframe" frameborder="0"   style="width:100%;height:100%;"></iframe>
</div>

Thank you!

Code:
    <script type="text/javascript">
        $(function () {
            $("#typeList").panel({
                onBeforeOpen: function () {
                    var url = "second.jsp";
                    $("#typeIframe").attr("src", url);
                }
            });
        });
    </script>

 <div title="Iframe" id="typeList" data-options="closable:true" style="overflow:hidden">
        <iframe scrolling="yes" id="typeIframe" frameborder="0"   style="width:100%;height:100%;"></iframe>
    </div>
version:1.4.1         Events onBeforeOpen Is OK. Events onOpen is OK
version 1.4.2-1.4.5 Events onBeforeOpen have a bug,but Events onOpen is OK
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!