Ext.tree.Panel樣本

來源:互聯網
上載者:User

1、基本樣本

代碼:

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head runat="server"> 4     <title>Ext.tree.Panel</title> 5     <link href="ext-4.0.7-gpl/resources/css/ext-all.css" rel="stylesheet" type="text/css" /> 6     <script src="ext-4.0.7-gpl/bootstrap.js" type="text/javascript"></script> 7     <script type="text/javascript"> 8         Ext.onReady(function () { 9             var tree = Ext.create("Ext.tree.Panel", {10                 title: "Tree樣本",11                 width: 150,12                 height: 100,13                 renderTo: Ext.getBody(),14                 root: {15                     text: "根",16                     expanded: true,17                     children: [{18                         text: "葉子1",19                         leaf: true20                     }, {21                         text: "葉子2",22                         leaf: true23                     }]24                 }25             });26         });27     </script>28 </head>29 <body style="margin: 10px;">30 </body>31 </html>

 

2、多列樹

代碼:

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head runat="server"> 4     <title>Ext.tree.Panel</title> 5     <link href="ext-4.0.7-gpl/resources/css/ext-all.css" rel="stylesheet" type="text/css" /> 6     <script src="ext-4.0.7-gpl/bootstrap.js" type="text/javascript"></script> 7     <script type="text/javascript"> 8         Ext.onReady(function () { 9             var tree = Ext.create("Ext.tree.Panel", {10                 title: "Tree多列樣本",11                 width: 200,12                 height: 150,13                 renderTo: Ext.getBody(),14                 fields: ["name", "description"],15                 columns: [{16                     xtype: "treecolumn", // 樹狀表格列17                     text: "名稱",18                     dataIndex: "name",19                     width: 100,20                     sortable: true21                 }, {22                     text: "描述",23                     dataIndex: "description",24                     flex: 1,25                     sortable: true26                 }],27                 root: {28                     name: "根",29                     description: "根描述",30                     expanded: true,31                     children: [{32                         name: "葉子1",33                         description: "葉子1描述",34                         leaf: true35                     }, {36                         name: "葉子2",37                         description: "葉子2描述",38                         leaf: true39                     }]40                 }41             });42         });43     </script>44 </head>45 <body style="margin: 10px;">46 </body>47 </html>

 

3、帶複選框的樹

代碼:

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.