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.