Coolite Learning Record-dynamic tab Creation

Source: Internet
Author: User

A few days ago, I came into contact with something coolite that I felt very good about. I was able to use it in my own research project, so I started my research.

Http://www.coolite.com/

Instance Website: http://examples.coolite.com/

Let's take a look.

The following shows the dynamic binding of coolite tabs.

 

Code

Type = "text/javascript" & gt; & lt ;! --
Function addTab (tabPanel, id, url ){
Var tab = tabPanel. getComponent (id );
If (! Tab ){
Tab = tabPanel. add ({
// Id: id. Note that you can comment out the ID. You do not need to dynamically generate a tab Based on the tab ID when calling the following code.
Title: url,
Closable: true,
AutoLoad :{
ShowMask: true,
Url: url,
Mode: 'iframe ',
MaskMsg: 'loading' + url +''
}
});
}
TabPanel. setActiveTab (tab );
}
// -- & Gt; & lt;/mce: script & gt;

The following is the process of calling this JavaScript code.

 

Code

& Lt; ext: MenuItem ID = "xiaomu" runat = "server" Text = "xiaomu" & gt;
& Lt; Listeners & gt;
& Lt; Click Handler = "addTab (# {TabPanel1}, 'Google ', 'HTTP: // www.google.com');"/& gt;
& Lt;/Listeners & gt;
& Lt;/ext: MenuItem & gt;

Here, google itself is a parameter, which is the ID of the new tab, because I have processed the JS function above, so it is OK to pass the value here.

In this way, dynamic calling is implemented.

 

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.