日期:2014-05-16  浏览次数:20411 次

ExtJs3.4项目应用备忘--PAJZ12xx.jsp
<%@page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<html>
<head>

		<title>采样审核详细信息</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/extjs/resources/css/ext-all.css" />
		<script type="text/javascript" src="<%=request.getContextPath()%>/extjs/adapter/ext/ext-base.js"></script>
		<script type="text/javascript" src="<%=request.getContextPath()%>/extjs/ext-all.js"></script>
	    <script type="text/javascript" src="<%=request.getContextPath()%>/extjs/ext-lang-zh_CN.js" charset="utf-8"></script>
		<script>  
			Ext.onReady(function(){

			// 获得父窗口的对象  
		   var parentwin = window.dialogArguments;   
		   var params = parentwin.document.getElementById("addReInfo").value; 
		   
			//列定义
		    var cm = new Ext.grid.ColumnModel([
		        new Ext.grid.RowNumberer(),//生成编号
		        {header:'<center>申请编号</center>', dataIndex:'SQBH', width:100,sortable:true,align:'right'},
		        {header:'<center>申请单位</center>', dataIndex:'SQDW', width:150},
		        {header:'<center>项目组</center>', dataIndex:'XMZ',width:130},
		        {header:'<center>年度</center>', dataIndex:'ND',width:80,sortable:true,align:'right'},
		        {header:'<center>地区</center>', dataIndex:'DQ',width:100},
		        {header:'<center>井号</center>',dataIndex:'JH',width:100},
		        {header:'<center>层位</center>', dataIndex:'CW',width:100},
		        {header:'<center>分析化验项目</center>', dataIndex:'FXHYXM',width:100},
		        {header:'<center>采样规格</center>', dataIndex:'CYGG',width:100},
		        {header:'<center>采样数量</center>', dataIndex:'CYSL',width:100,align:'right'},
		        {header:'<center>备注</center>', dataIndex:'BZ',width:200}
		    ]);
		    
		    //数据源
			var store = new Ext.data.Store({
				//参数
				baseParams: {flg:'getXXSQYPBInfo',param:params}, 
				//代理
		        proxy: new Ext.data.HttpProxy({
		        	url:'<%=request.getContextPath()%>/pajz12Servlet', method:'post'
		        }),
		        //数据格式
		        reader: new Ext.data.JsonReader({
		            totalProperty: 'totalProperty',
		            root: 'root'
		        },[
		            {name: 'SQBH'},
		            {name: 'SQDW'},
		            {name: 'XMZ'},
		            {name: 'ND'},
		            {name: 'DQ'},
		            {name: 'JH'},
		            {name: 'CW'},
		            {name: 'FXHYXM'},
		            {name: 'CYGG'},
		            {name: 'CYSL'},
		            {name: 'BZ'}
		        ])
	    	});
	    	
	    	////////创建表格对象
		    var grid = new Ext.grid.GridPanel({
		        width: Ext.get("grid").getWidth(), //指定表格的宽度为div的宽度
				height: Ext.get("grid").getHeight(), //指定表格的宽度为div的高度
		        renderTo: 'grid',
		        store: store,
		        cm: cm,
		        //添加分页控件
		        bbar: new Ext.PagingToolbar({
		            pageSize: 15,//页面容量
		            store: store,//数据源
		            displayInfo:true,//显示消息
		            displayMsg:'显示第 {0} 条到 {1} 条记录,一共 {2} 条记录',//有数据时的消息
		            emptyMsg:"没有记录"//无数据的消息
		        }),
		        bodyStyle:"width:100%", 
		        viewConfig:{
		        	forceFit:true
		        }
		    });
		    
		    store.load({params:{start:0,limit:15}});
          });
		</script>  
	
</head>
	<body align="center">
		<div id="grid" style="width:1024px;height:380px;"></div>
	</body>
</html>

?