EasyUI Forum

General Category => Bug Report => Topic started by: cmwalolo on April 02, 2012, 07:07:34 AM



Title: Closing Tab Panel
Post by: cmwalolo on April 02, 2012, 07:07:34 AM
I got some trouble with the tab controls

Code:
                var tabx = $(this.root.baseDiv).tabs("getTabIndex", this.settings.Text);
                $(this.root.baseDiv).tabs("close", tabx);
                $(this.root.baseDiv).tabs("add", { title: this.settings.Text, content: this.baseDiv, closable: true });

This is totally not working ! It doesn't close the tabs, and if I delete manually, it will create two tabs on next try.
 

If I replace second line with :                 $(this.root.baseDiv).tabs("close", 0);

The tab is only removed the second time, I add a tab ! And always with double tabs.





Title: Re: Closing Tab Panel
Post by: cmwalolo on April 02, 2012, 07:37:26 AM
Bon bon... I made a sample test, and it seems to work... So It's like it doesn't like my code or layout somewhere

Code:
<head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <title>Lucene Index</title>
    <link rel="stylesheet" type="text/css" href="/CMWA.NET/styles/site.css">
    <link rel="stylesheet" type="text/css" href="/CMWA.NET/styles/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="/CMWA.NET/styles/themes/icon.css">
    <script type="text/javascript" src="/CMWA.NET/scripts/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="/CMWA.NET/scripts/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/CMWA.NET/Scripts/json2.min.js"></script>
    <script type="text/javascript" src="/CMWA.NET/Scripts/ServiceProxy.js"></script>

    <script type="text/javascript" src="/CMWA.NET/Scripts/CMWA/Apps/Controls/LayoutControl.js"></script>
    <script type="text/javascript" src="/CMWA.NET/Scripts/CMWA/DataEditor/DataEditor.js"></script>
    <script type="text/javascript" src="/CMWA.NET/Scripts/CMWA/DataEditor/Containers/SimpleContainer.js"></script>
    <script type="text/javascript" src="/CMWA.NET/Scripts/CMWA/DataEditor/Containers/Accordion.js"></script>
    <script type="text/javascript" src="/CMWA.NET/Scripts/CMWA/DataEditor/Containers/Toolbar.js"></script>
    <script type="text/javascript" src="/CMWA.NET/Scripts/CMWA/DataEditor/Actions/LinkButton.js"></script>
</head>
<body class="easyui-layout">
    <div region="north" title="North Title" split="true" style="height: 100px;">
    </div>
    <div region="south" title="South Title" split="true" style="height: 100px;">
    </div>
    <div region="east" iconcls="icon-reload" title="East" split="true" style="width: 100px;">
    </div>
    <div region="west" split="true" title="West" style="width: 100px;">
    </div>
    <div region="center" title="center title" style="padding: 5px; background: #eee;">
        <div id="tabs" class="easyui-tabs" fit="true">
            <div title="First Tab" style="padding: 10px;">
               <div class="easyui-layout" fit="true">
                    <div region="south" title="North Title" split="true" style="height:100px">
                    </div>
                    <div region="center" title="center title" style="padding: 5px; background: #eee;">
                    </div>
                </div>
            </div>
            <div title="Second Tab" closable="true" style="padding: 10px;">
                Second Tab
            </div>
            <div title="Third Tab" iconcls="icon-reload" closable="true" style="padding: 10px;">
                Third Tab
            </div>
        </div>
    </div>

   <script>
       $(function () {
           $("#tabs").tabs("close", 0);
           $("#tabs").tabs("add", { title: "coucou", content: "<P>Test</P>", closable: true });
           $("#tabs").tabs("close", "coucou");

       });
   </script>
</body>