Ext.TabPanel示例

花了一个下午做了一个简单的TabPanel示例(ExtJS 4.0版本API):


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>TabPanelTest(extjs 4)</title>

    <link rel="stylesheet" type="text/css" href="css/ext-all.css" />

    <script type="text/javascript" src="extjs/ext-all.js"></script>

    <script type="text/javascript">
    Ext.onReady(function(){
        var panel1 = new Ext.Panel({
            title: "C/C++",
            html: "<h2>C/C++编程语言</h2>",
            height: 300,
            closable: true
        });
        var panel2 = new Ext.Panel({
            title: "Java",
            html: "<h1>Java编程语言</h1>",
            height: 300,
            closable: true
        });
        var items = [panel1, panel2];
        var tabs = new Ext.TabPanel({ //Ext.createWidget('tabpanel',
            activeTab: 0,
            items: items,
        });
        var basic = new Ext.Window({
            applyTo: document.body,
            layout: "fit",
            modal: true,
            plain: true,
            title: "编程语言",
            height: 300,
            width: 400,
            items: tabs,
            closable: true
        });
        basic.show();
    });
    </script>
</head>

<body>

</body>
</html>

  效果图:

Ext.TabPanel示例_第1张图片


你可能感兴趣的:(Ext.TabPanel示例)