上个图:
代码如下:
</pre><pre name="code" class="html"><%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>My JSP 'index.jsp' starting page</title> <Meta http-equiv="pragma" content="no-cache"> <Meta http-equiv="cache-control" content="no-cache"> <Meta http-equiv="expires" content="0"> <Meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <Meta http-equiv="description" content="This is my page"> <!-- css文件 --> <link rel="stylesheet" href="resources/dojo/dijit/themes/claro/claro.css"> <link rel="stylesheet" href="resources/dojo/dijit/themes/nihilo/nihilo.css"> <link rel="stylesheet" href="resources/dojo/dijit/themes/soria/soria.css"> <link rel="stylesheet" href="resources/dojo/dijit/themes/tundra/tundra.css"> <!-- gridContainer的css文件 --> <link rel="stylesheet" href="resources/dojo/dojox/layout/resources/GridContainer.css"> <link rel="stylesheet" href="resources/dojo/dojox/layout/resources/DndGridContainer.css"> <style type="text/css"> @import "resources/dojo/dojox/grid/resources/claroGrid.css"; @import "resources/dojo/dojox/grid/enhanced/resources/claro/EnhancedGrid.css"; @import "resources/dojo/dojox/grid/enhanced/resources/EnhancedGrid_rtl.css"; html,body,#main{ width: 100%; /* make the body expand to fill the visible window */ height: 100%; padding: 0 0 0 0; margin: 0 0 0 0; font: 10pt Arial,Myriad,Tahoma,Verdana,sans-serif; } </style> <script type="text/javascript" src="resources/dojo/dojo/dojo.js" djConfig="parSEOnLoad:true"></script> <script type="text/javascript"> require([ "dojo/parser","dojo/data/ItemFileWriteStore","dojo/request/xhr","dijit/layout/BorderContainer","dojox/layout/GridContainer","dijit/layout/TabContainer","dojox/layout/ContentPane","dijit/TitlePane","dojox/grid/DataGrid","dijit/dijit","dojo/ready" ],function(Parser,ItemFileWriteStore,xhr,BorderContainer,GridContainer,TabContainer,ContentPane,TitlePane,grid,dijit,ready){ ready(function(){ /*set up data store*/ var data = { identifier: 'id',items: [] }; var data_list = [ { col1: "normal",col2: false,col3: 'But are not followed by two hexadecimal',col4: 29.91},{ col1: "important",col3: 'Because a % sign always indicates',col4: 9.33},col3: 'Signs can be selectively',col4: 19.34} ]; var rows = 60; for(var i=0,l=data_list.length; i<rows; i++){ data.items.push(dojo.mixin({ id: i+1 },data_list[i%l])); } var store = new dojo.data.ItemFileWriteStore({data: data}); /*set up layout*/ var layout = [[ {'name': 'Column 1','field': 'id','width': '100px'},{'name': 'Column 2','field': 'col2','width': '100px',editable: true,type: dojox.grid.cells.CheckBox,styles: 'text-align: center;'},{'name': 'Column 3','field': 'col3','width': '200px',editable: true},{'name': 'Column 4','field': 'col4','width': '150px',editable: true} ]]; /*create a new grid:*/ var grid = new dojox.grid.DataGrid({ id: 'grid',store: store,structure: layout,rowSelector: '20px'},document.createElement('div')); /*append the new grid to the div*/ dojo.byId("gridDiv").appendChild(grid.domNode); /*Call startup() to render the grid*/ grid.startup(); }); }); </script> </head> <body class="claro"> <div id="main" data-dojo-type="dijit/layout/BorderContainer" data-dojo-props='design:"heading" '> <div id="mainTop" data-dojo-type="dojox/layout/ContentPane" data-dojo-props='region:"top",style:"height: 70px;"'> </div> <div id="mainLeading" data-dojo-type="dojox/layout/ContentPane" data-dojo-props='region:"leading",style:"width: 250px;"'> <div id="ac_pane1" data-dojo-type="dijit/TitlePane" data-dojo-props="open:true,title:'Item1'"> <button onclick="makeTab();">click to add tab</button> </div> <div id="ac_pane2" data-dojo-type="dijit/TitlePane" data-dojo-props='open:true,title:"Item2"'> </div> <div id="ac_pane3" data-dojo-type="dijit/TitlePane" data-dojo-props='open:true,title:"Item3"'> </div> <div id="ac_pane4" data-dojo-type="dijit/TitlePane" data-dojo-props='open:true,title:"Item4"'> </div> </div> <div data-dojo-type="dojox/layout/ContentPane" region="center" style="padding:0px; margin:0px;"> <div data-dojo-type="dijit/layout/TabContainer"> <div data-dojo-type="dojox/layout/ContentPane" title="主页" data-dojo-props="selected:true"> <div data-dojo-type="dojox/layout/GridContainer" nbZones="3" opacity="0.7" allowAutoScroll="true" hasResizableColumns="false" withHandles="true" dragHandleClass="dijitTitlePaneTitle" acceptTypes="TitlePane"> <div data-dojo-type="dijit/TitlePane" dndType="TitlePane" title="Title pane 1"><a href="http://www.baidu.com">title pane 1</a></div> <div data-dojo-type="dijit/TitlePane" dndType="TitlePane" title="Title pane 2">title pane 2</div> <div data-dojo-type="dijit/TitlePane" dndType="TitlePane" title="Title pane 3">title pane 3</div> <div data-dojo-type="dijit/TitlePane" dndType="TitlePane" title="Title pane 4"> Non </div> <div data-dojo-type="dijit/TitlePane" dndType="TitlePane" title="Title pane 5"> Non </div> <div data-dojo-type="dijit/TitlePane" dndType="TitlePane" title="Title pane 6"> Non </div> <div data-dojo-type="dijit/TitlePane" dndType="TitlePane" title="Title pane 7"> Non </div> </div> </div> <div data-dojo-type="dijit/layout/BorderContainer" gutters="false" data-dojo-props='region:"center",design:"headline"' title="dataGrid" > <div data-dojo-type="dojox/layout/ContentPane" data-dojo-props='region:"top",style:"height: 40px;"'> dataGrid组件 </div> <div data-dojo-type="dojox/layout/ContentPane" data-dojo-props='region:"center"' style="padding:2px; margin:0px;"> <div id="gridDiv" style="height:100%;"></div> </div> <div data-dojo-type="dojox/layout/ContentPane" style="padding:0px; margin:0px; height: 30px;" data-dojo-props='region:"bottom"'> 我是底部 </div> </div> <!-- grid/enhanced组件 --> <div data-dojo-type="dojox/layout/ContentPane" title="My last tab" data-dojo-props="closable:true"> <div data-dojo-type="dijit/layout/BorderContainer" gutters="false"> <div data-dojo-type="dojox/layout/ContentPane" data-dojo-props='region:"top",style:"height: 40px;"'> grid/enhanced组件 </div> <div data-dojo-type="dojox/layout/ContentPane" data-dojo-props='region:"center"' style="padding:2px; margin:0px;"> </div> </div> </div> </div> </div> <div id="mainBottom" data-dojo-type="dojox/layout/ContentPane" data-dojo-props='region:"bottom",style:"height:30px;"'> </div> </div> </body> </html>