Extjs4 --- tab -- Basic tab

Source: Internet
Author: User
Tags autoload

Complete code:

1. Basic Tab

TabPanel.html:
[Html]
<! Doctype html public "-// W3C // dtd html 4.01 Transitional // EN">
<Html>
<Head>
<Meta http-equiv = "content-type" content = "text/html; charset = UTF-8">
<Title> Form </title>

<Link rel = "stylesheet" type = "text/css" href = "ext4/resources/css/ext-all.css">
<Script type = "text/javascript" src = "ext4/ext-all.js"> </script>
<Script type = "text/javascript" src = "js/tabPanel. js"> </script>
 
</Head>

<Body>
<Div style = "display: none;">
<Div id = "tab2">
Data imported from the div of the page
</Div>
</Div>
</Body>
</Html>

TabPanel. js

[Javascript]
Ext. require (
'Ext. tab .*'
);
Ext. onReady (



Function (){
Ext. create (
'Ext. tab. Panel ',
{
RenderTo: Ext. getBody (),
ActiveTab: 0,
Width: 600,
Height: 300,
Plain: true,
Defaults :{
AutoScoll: true
},
Items :[
{
// Id: 'tab1 ',
Title: 'tabs-1 ',
Html: 'This is a common tab'
},{
Title: 'tab-2 ',
ContentEl: 'tab2'
},{
// Id: 'tab2 ',
Title: 'ajax tab ',
AutoLoad :{
Url: 'tabaction ',
Params :{
Data: 'parameters passed in from the Client'
},
Method: 'get'
}

},{
Title: 'event tab ',
Listeners :{
Activate: function (tab ){
Alert (tab. title + ': activate event triggered. ');
}
},
Html: 'tab with event ',
AutoLoad: false
},{
Title: 'unavailable tab ',
Disabled: true
}
]
}
);
}
);

:

Related Article

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.