JQuery easyui Tab TAB issues summary _jquery

Source: Internet
Author: User

Issues to be addressed:

For example, when I first opened the administrative area page, I turned on the Product Type Management page, and then I added a data to the product type management, and when I clicked on the Horizontal Administrative Area tab, I needed to use the data added to the product type management post, but there was no data in the administrative area. I wanted this data to show up, so I thought that when I clicked on the Horizontal tab, I wanted to refresh the page. Then the data will be displayed.

The main thing is I have no idea what I click on the Horizontal tab to trigger the event. The code is as follows:

Html

tab

<div data-options= "region: ' Center ', collapsible:false" > <div id= "maintabs" class= "Easyui-tabs"
data-options= "Fit:true,narrow:true" >
<div title= "Home" style= "Overflow:hidden;" data-options= "IconCls: ' FA Fa-home ' ">
<div id=" Myclock "style=" margin:0 auto;width:400px; "class=" clock "></div> 
</ div>
</div> 
</div>

Js

To add a horizontal tab

function AddTab (title, URL) {
if ($ (' #mainTabs '). Tabs (' exists ', title) {
$ (' #mainTabs '). Tabs (' select ', title );
} else {
var content = ' <iframe scrolling= ' auto ' frameborder= ' 0 ' src= ' + url+ ' "style= ' width:100%;height:99%;" ></iframe> ';
$ (' #mainTabs '). Tabs (' Add ', {
title:title, 
content:content, 
closable:true,
cache:true, 
});
}

Click on the Left tab

function Clicktree (node) {
if ($). Tree (' isleaf ', Node.target)) {
AddTab (Node.text, Node.attributes.url); 
} else {
$ (this). Tree (' Toggle ', node.target);
}

The problem is solved!

Idea: The main thing is to click on the Horizontal tab, reload the data.

 function addtab (title, URL) {if ($ (' #mainTabs '). Tabs (' exists ', title)) {$ (' #mainTabs '). T
ABS (' select ', title); else {var content = ' <iframe scrolling= ' auto ' frameborder= ' 0 ' src= ' + url+ ' "style= ' width:100%;height:99%;"
></iframe> '; 
$ (' #mainTabs '). Tabs (' Add ', {title:title, content:content, Closable:true, Cache:true,}); 
}} function Clicktree (node) {if ($). Tree (' isleaf ', Node.target)) {AddTab (Node.text, Node.attributes.url); /* Get the Horizontal tab/var content = ' <iframe scrolling= ' auto ' frameborder= ' 0 ' src= ' + node.attributes.url+ ' "style=" width:100 %;height:99%; "
></iframe> '; $ (' #mainTabs '). Tabs ({onselect:function (title) {var Currtab = $ (' #mainTabs '). Tabs (' Gettab ', title, 
Node.attributes.url);
var iframe = $ (currtab.panel (' Options '). Content); 
var src =iframe.attr (' src ');
$ (' #mainTabs '). Tabs (' Update ', {options: {title:title, HREF:SRC}}); 
}
}); 
} else {$ (this). Tree (' Toggle ', node.target);} 

Screenshot of Effect:

Open Product type and base product page first

Add data to a product type

Add data to the base product

I want the effect to reach!

Main code:

var content = ' <iframe scrolling= "auto" frameborder= "0" src= "' + node.attributes.url+ '" style= "width:100%;height:99% ;" ></iframe> ';
$ (' #mainTabs '). Tabs ({
onselect:function (title) {
var currtab = $ (' #mainTabs '). Tabs (' Gettab ', title, Node.attributes.url); 
var iframe = $ (currtab.panel (' Options '). content);
var src =iframe.attr (' src '); 
$ (' #mainTabs '). Tabs (' Update ', { 
options: {
title:title,
href:src
}
});
}
);

The above is small set to introduce the JQuery easyui tab tab Problem Summary, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.