EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: slvu on August 22, 2012, 02:40:37 AM



Title: Something wrong with Tabs
Post by: slvu on August 22, 2012, 02:40:37 AM

In my index.jsp, i used the tabs to show the content of tab1.jsp and tab2.jsp.

THE PROBLEM IS:

When i clicked the tabs(both tab1,tab2 ) the first time, the content would be shown in the center region, BUT closed at once automaticly.
and then it just work correctly.


Pls pay attention to the content in RED COLOR. Thank you very much and Look forward to your reply

the coding is following.

Code:
  <body class="easyui-layout" >
            <div region="west" split="true" title="" style="width:160px;">
    <p style="height:1px"></p>
        <ul>
            <li><a id="tab1" href="#" onclick="addTab('Tab1','tab1.jsp')">Tab1</a></li> 
            <li><a id="tab2" href="#" onclick="addTab('Tab2','tab2.jsp')">Tab2</a></li> 
            <li></li> 
           
        </ul>
    </div> 
   
    <div region="center" title="" style="padding:5px;background:#eee;">
    <div id="tabs" class="easyui-tabs" fit="true" border="false">
    <div title="Welcome" style="padding:20px;"> 
    <p>Welcome!</p>
     </div>
    </div>
    </div>
 </body>



There is a JS file, just like that.

Code:
function addTab(title, href) {
var tt = $('#tabs');
if (tt.tabs('exists', title)) {
tt.tabs('select', title);
} else {
if (href) {
var content = '<iframe scrolling="yes" frameborder="0"  src="' + href + '" style="width:100%;height:100%;padding:0px;"></iframe>';
} else {
var content = 'waiting';
}
tt.tabs('add', {
title : title,
closable : true,
content : content,
selected: true
});
}
};


Title: Re: Something wrong with Tabs
Post by: slvu on August 22, 2012, 02:42:09 AM
i used the jquery-easyui-1.3.


Title: Re: Something wrong with Tabs
Post by: stworthy on August 23, 2012, 05:14:47 AM
It seems that there are no problems with the code. When clicking the tab title of panel, the panel would be opened not closed.


Title: Re: Something wrong with Tabs
Post by: slvu on August 23, 2012, 06:29:15 PM
oh,no...My god.

But the panel really opened and closed soon..... just one click, the actions followed.

It seems that there are no problems with the code. When clicking the tab title of panel, the panel would be opened not closed.