EasyUI Forum
May 04, 2024, 08:19:12 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: tab + refresh  (Read 4225 times)
rezzonico
Full Member
***
Posts: 183


View Profile
« on: February 18, 2021, 08:45:35 AM »

I refresh the second tab (index = 1) with the following code:

$('#tt').tabs('getTab', 1).panel('refresh');

The problem is that I want to refresh the tab only if it has already been selected by the user.
How can I verify this ?
It may be that I need to verify the length of the tab content ...

<div id="tt" class="easyui-tabs" border="true">
    <div title="AAA" href="aaa.html"></div>
    <div title="BBB" href="bbb.html"></div>
</div>

Thanks for any help.
Miche
« Last Edit: February 18, 2021, 08:49:08 AM by rezzonico » Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: February 18, 2021, 11:53:25 PM »

Listen to the 'onSelect' event on the tabs component and you can decide whether to refresh the selected tab panel or not.
Code:
$('#tt').tabs({
onSelect: function(title,index){
$('#tt').tabs('getTab',index).panel('refresh');
}
})
Logged
rezzonico
Full Member
***
Posts: 183


View Profile
« Reply #2 on: February 24, 2021, 01:40:20 AM »

Thanks !

Regards
Miche
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!