EasyUI Forum
December 08, 2024, 04:51: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: easyui tabs and panel BUG  (Read 59504 times)
mars610
Newbie
*
Posts: 13


View Profile Email
« 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");

Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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.
Logged
mars610
Newbie
*
Posts: 13


View Profile Email
« Reply #2 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.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 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
   });   
Logged
mars610
Newbie
*
Posts: 13


View Profile Email
« Reply #4 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.
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!