EasyUI Forum

General Category => Bug Report => Topic started by: mars610 on July 14, 2011, 11:40:23 PM



Title: easyui tabs and panel BUG
Post by: mars610 on July 14, 2011, 11:40:23 PM
The version of 1.2.4 has two bugs:
1. The method of add for tabs, use the property 'href' to load remote content to fill the tab panel; when first create new tab,the  send twice request. such as:

function addTab(title, url){   
     if ($('#tt').tabs('exists', title)){   
   $('#tt').tabs('select', title);   
     } else {   
    $('#tt').tabs('add',{   
      title:title,
      href: url,
      closable:true,
      cache:false
   });   
   }   
}


2. the panel set property 'href', use method 'refresh', easyui also send twice request;such as:
$('#p').panel({
      title: 'My Panel',
      href: xxxx.jsp
})
$('#p').panel("refresh");



Title: Re: easyui tabs and panel BUG
Post by: stworthy on July 15, 2011, 12:04:03 AM
For the first question, set 'cache' property to true to prevent reload page when select tab panel.

For the second question, when create panel with 'href' property, the remote page content will be loaded.
$('#p').panel({
      title: 'My Panel',
      href: xxxx.jsp
});
The code above will create a panel and send a remote request to load content.
Call 'refresh' will reload the panel content again, so a content page request will be sent to remote server again.


Title: Re: easyui tabs and panel BUG
Post by: mars610 on July 15, 2011, 12:59:22 AM
For the first question, set 'cache' property to true to prevent reload page when select tab panel.

For the second question, when create panel with 'href' property, the remote page content will be loaded.
$('#p').panel({
      title: 'My Panel',
      href: xxxx.jsp
});
The code above will create a panel and send a remote request to load content.
Call 'refresh' will reload the panel content again, so a content page request will be sent to remote server again.

Thanks for your reply. But the first Bug, I set 'cache' property to true ,the Problem still. I try to change easyui version to '1.2.3' ,the Bug does not exist.


Title: Re: easyui tabs and panel BUG
Post by: stworthy on July 15, 2011, 02:25:45 AM
Try the below code, set the 'closed' to true to create a hidden panel and the open it.

    $('#tt').tabs('add',{   
      title:title,
      href: url,
      closable:true,
      closed:true,
      cache:true
   });   


Title: Re: easyui tabs and panel BUG
Post by: mars610 on July 17, 2011, 06:37:56 PM
Try the below code, set the 'closed' to true to create a hidden panel and the open it.

    $('#tt').tabs('add',{   
      title:title,
      href: url,
      closable:true,
      closed:true,
      cache:true
   });   


Thanks for your help again! set the 'closed' to true ,only send one request.