I am using the jquery easyui to implement tabs. However, there is no reload function on the tabs. There is an reload example on official document, but it seems that it is just adding a reload icon instead of having an actual reload function:
<div title="Tab3" iconCls="icon-reload" closable="true" style="padding:20px;display:none;">
Therefore, how to have the actual reload function when I press the reload icon?
Here is that document , it is short and finish read in a minute tabs document
Updated:
Refresh function:
$(document).ready(function(){
$('#tt').tabs({
onSelect: function (title) {
var currTab = $('#tabs').tabs('getTab', title);
var iframe = $(currTab.panel('options').content);
var src = iframe.attr('src');
$('#tt').tabs('update', {
tab: currTab, options: { content: createFrame(src)}
});
}
});
});
Add tab will add a icon-reload
:
function addTab(title, url){
if ($('#tt').tabs('exists', title)){
$('#tt').tabs('select', title);
} else {
var content = '<iframe scrolling="auto" frameborder="0" src="'+url+'" style="width:100%;height:100%;"></iframe>';
$('#tt').tabs('add',{
title:title,
iconCls:'icon-reload',
content:content,
closable:true
});
}
}
The icon in html:
<a href="javascript:void(0)" class="tabs-inner">
<span class="tabs-title tabs-closable tabs-with-icon">Create List</span>
<span class="tabs-icon icon-reload"></span>
</a>
How do I use icon-reload
to call the function to reload the tab?