Gets the selected Tab
Gets the tab panel selected and its tab object var pp = $ (' #tt '). Tabs (' getselected '); var tab = pp.panel (' Options '). tab; The corresponding Tab object
Update a specific tab panel using the Update method, the Param parameter contains 2 properties:
Tab: The tab that will be updated.
Options: Tab-related configuration items.
Example:
// current tab Update tabs operation var current_tab = $ (' #frame_tabs '). Tabs (' getselected '); $ (' #frame_tabs '). Tabs ( ' Update ', { tab:current_tab, options: { ' <iframe scrolling= ' auto ' frameborder= ' 0 ' src= ' + url+ ' "style=" width:100%;height:100%; ></iframe> ', // }}); $ (document). Ready (function () { $ (' #frame_tabs '). Bind (' DblClick ', function () { = $ ('). Tabs-selected '). text (); $ (' #frame_tabs '). Tabs (' Close ', title); });
Re:tabs How to make a specific tab selected when initializing
$ (' #tt '). Tabs (' Update ', {tab:$ (' #tt '). Tabs (' Gettab ', ' Tab2 '), options:{selected:true }});
Currently used in my project Yes is
<div id= "Tabs"class= "Easyui-tabs" style= "width:1160px;" ><div id= "tabs-1" title= "basic Information" data-options= "Fit:true" ><div id= " Tabs-2 "title=" Bidding Information "data-options=" Selected:true ">//This will be loaded when the state is selected can be in the background to save a global variable, and then assign the value to the interface, the value of the interface via JS, and then judge the setting increase data-options= "selected:true"function Settab () {var sTab= $ ("#selectTab"). Val (); if(STab = = "1") { $("#tabs"). Tabs ("select", 0); } if(STab = = "2") { $("#tabs"). Tabs ("select", 1); //$ ("#tabs-2"). attr ("Data-options", "selected:true"); } if(STab = = "3") { $("#tabs"). Tabs ("select", 2); } if(STab = = "4") { $("#tabs"). Tabs ("Select", 3); } }
Select the Ztree content and implement the update Add feature. Update is done without tabs adding add implementation exits.
$ ("#tree"). Tree ({data:treedata, lines:true, Onclick:function (node) {//alert (node.id); if(node.attributes) {opentab (Node.text,node.attributes.url); } } }); function Opentab (text,url) {if($ ("#tabs"). Tabs (' exists ', text)) { //$ ("#tabs"). Tabs (' select ', text); //window.location.reload ();var Current_tab = $ (' #tabs '). Tabs (' getselected ')); $(' #tabs '). Tabs (' Update ', {tab:current_tab, options: {content:' <iframe scrolling= ' auto ' frameborder= ' 0 "src=" ' +url+ ' "style=" width:100%;height:100%; " ></iframe> ', //or href: "; } }); }Else{var content= "<iframe frameborder= ' 0 ' scrolling= ' auto ' style= ' width:100%;height:100% ' src=" +url+ "></iframe>"; $("#tabs"). Tabs (' Add '), {title:text, closable:true, content:content}); } }
Select a specific tab and update based on the jquery Easyui