EXTJS 布局

  1 <!DOCTYPE html>
  2 <html>
  3 <head>
  4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  5     <script src="Extjs/bootstrap.js"></script>
  6     <link href="Extjs/packages/ext-theme-neptune/build/resources/ext-theme-neptune-all.css" rel="stylesheet" />
  7     <script src="Extjs/packages/ext-theme-neptune/build/ext-theme-neptune.js"></script>
  8     <title></title>
  9     <meta charset="utf-8" />
 10     <style type="text/css">
 11         /**去掉ExtJS5.1试用版本水印**/
 12         .x-title-text-default::after {
 13             display:none;
 14         }
 15     </style>
 16 </head>
 17 <body>
 18     <script language="javascript">
 19         CreateViewPort = function (wTitle,sTitle,eTitle,tree){
 20             Ext.create(‘Ext.container.Viewport‘, {
 21                 layout: ‘border‘,
 22                 items: [{
 23                     region: ‘north‘,
 24                     html: ‘‘,
 25                     border: false,
 26                     height: 100,
 27                     bodyStyle: ‘background:#157fcc; padding:10px;‘,
 28                     margin: ‘0 0 5 0‘
 29                 }, {
 30                     region: ‘west‘,
 31                     collapsible: true,
 32                     split: true,
 33                     title: wTitle,
 34                     items:tree,
 35                     width: 350
 36                 }, {
 37                     region: ‘south‘,
 38                     title: sTitle,
 39                     collapsible: true,
 40                     collapsed:true,
 41                     html: ‘显示内容在这里‘,
 42                     split: true,
 43                     height: 100,
 44                     minHeight: 100
 45                 }, {
 46                     region: ‘east‘,
 47                     title: eTitle,
 48                     collapsible: true,
 49                     split: true,
 50                     width: 350
 51                 }, {
 52                     region: ‘center‘,
 53                     xtype: ‘tabpanel‘,
 54                     activeTab: 0,
 55                     items: [{
 56                         title: ‘首页‘,
 57                         html: ‘显示内容在这里‘
 58                     }, {
 59                         title: ‘第二页‘,
 60                         html: ‘显示内容在这里‘
 61                     }, {
 62                         title: ‘最后页‘,
 63                         html: ‘显示内容在这里‘
 64                     }]
 65                 }]
 66             });
 67         }
 68         var store = Ext.create(‘Ext.data.TreeStore‘, {
 69             root: {
 70                 expanded: true,
 71                 children: [
 72                     { text: "detention", leaf: true },
 73                     {
 74                         text: "homework", expanded: true, children: [
 75                           { text: "book report", leaf: true },
 76                           { text: "algebra", leaf: true }
 77                         ]
 78                     },
 79                     { text: "buy lottery tickets", leaf: true }
 80                 ]
 81             }
 82         });
 83
 84        var tree =  Ext.create(‘Ext.tree.Panel‘, {
 85             //title: ‘Simple Tree‘,
 86             width: 350,
 87             //height: 150,
 88             store: store,
 89             //rootVisible: false,
 90             //renderTo: Ext.getBody()
 91         });
 92         Ext.application({
 93             name: ‘myApp‘,
 94             launch: function () {
 95                 CreateViewPort(‘导航菜单‘, ‘状态栏‘, ‘属性窗口‘,tree);
 96             }
 97         });
 98         //Ext.onReady(function () {
 99         //    CreateViewPort(‘导航菜单‘,‘状态栏‘,‘属性窗口‘);
100         //});
101     </script>
102 </body>
103 </html>
时间: 2024-10-08 02:05:07

EXTJS 布局的相关文章

extjs布局(一)

Ext常用的布局都在Ext.layout下,这里几乎涵盖了所有的布局方式,满足开发者需求.那么我们就其中常用的方式逐一介绍. Border布局 Border布局是Ext中常用布局方式(经常用到整个页面的总体布局),感觉用的几率很大.在看代码之前先熟悉一种特殊的容器ViewPort,它是对于浏览器视窗的抽象,你可以将它理解为浏览器的可见区域,它将渲染到document.body并自动调整大小,一个页面只能创建一个Viewport. var pnNorth=new Ext.Panel({ id:'p

ExtJs布局之viewport

<!DOCTYPE html> <html> <head> <title>ExtJs</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" type="text/css" href="ExtJs/

ExtJs布局之border

<!DOCTYPE html> <html> <head> <title>ExtJs</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" type="text/css" href="ExtJs/

ExtJs布局之BOX

<!DOCTYPE html> <html> <head> <title>ExtJs</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" type="text/css" href="ExtJs/

ExtJs布局之Column

<!DOCTYPE html> <html> <head> <title>ExtJs</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" type="text/css" href="ExtJs/

ExtJs布局之table

<!DOCTYPE html> <html> <head> <title>ExtJs</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" type="text/css" href="ExtJs/

ExtJs布局之tabPanel

<!DOCTYPE html> <html> <head> <title>ExtJs</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" type="text/css" href="ExtJs/

extjs布局

border布局:标准的上下左右中布局方式 Ext.onReady(function() { Ext.create('Ext.container.Container', { width: 400, height: 400, renderTo: Ext.getBody(), layout: "border", items: [{ region: "west", title: 'west', width:100 }, { region: "east"

ExtJs布局大全

1.Fit 布局 在Fit 布局中,子元素将自动填满整个父容器.注意:在fit 布局下,对其子元素设置宽度是无效的.如果在fit 布局中放置了多个组件,则只会显示第一个子元素.在Fit 布局中,子元素将自动填满整个父容器.典型的案例就是当客户要求一个window 或panel 中放置一个GRID 组件,grid 组件的大小会随着父容器的大小改变而改变. 效果图: 示例代码: Ext.create('Ext.container.Viewport', { layout: 'fit', items: