Select a specific tab_jquery based on jquery Easyui

Source: Internet
Author: User

Get the selected Tab

  Gets the selected tab panel 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 
var Current_tab = $ (' #frame_tabs '). Tabs (' getselected '); 
$ (' #frame_tabs '). Tabs (' Update ', { 
   tab:current_tab, 
   options: { 
     content: ' <iframe scrolling= ' auto ' Frameborder= "0" src= "' +url+ '" "style=" width:100%;height:100%; " ></iframe> ', 
   //or href: '; 
   } 
}; 
$ (document). Ready (function () { 
  $ (' #frame_tabs '). Bind (' DblClick ', function () { 
    var title = $ ('. Tabs-selected '). Text (); 
    $ (' #frame_tabs '). Tabs (' close ', title); 
  }) 

How to make a specific tab selected when Re:tabs initialization

lyw985lyw985 Aug 10:44
$ (' #tt '). Tabs (' Update ', {
tab:$ (' #tt '). Tabs (' Gettab ', ' Tab2 '),
options:{
Selected:true
}
});

Currently used in my project is yes

<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=" Bid Information "data-options=" Selected:true ">//this is checked at load time. You can save a global variable in the background, Then the assignment to the interface, through the value of JS interface, and then determine 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);
    }
  

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.