ext grid HttpProxy store servlet 페이지 나누기

3380 단어 htmlservletext
제가 바로 코드를 올렸어요.

Ext.onReady(function(){

	//     
	var cm = new Ext.grid.ColumnModel([
		{header:'  ',width:50,dataIndex:'Id'},
		{header:'  ',width:80,dataIndex:'Name',tooltip:'      '},
		{header:'  ',width:40,dataIndex:'Sex',align:'center'},
		{header:'  ',width:80,dataIndex:'Education',align:'center'},
		{id:'memo',header:'  ',dataIndex:'Memo'}
	]);
	
	
	
	//proxy
	var proxy = new Ext.data.HttpProxy({url:"servlet/PageServlet",method:'post'});
	
	//record
	var human = Ext.data.Record.create([
		{name:'Id',type:'string',mapping:'hid'},
		{name:'Name',type:'string',mapping:'name'},
		{name:'Sex',type:'string',mapping:'sex'},
		{name:'Education',type:'string',mapping:'edu'},
		{name:'Memo',type:'string',mapping:'memo'}
	]);
	
	//reader
	var reader = new Ext.data.JsonReader({totalProperty:'totalProperty',root:'root'},human);
	//store
	var store = new Ext.data.Store({
		proxy:proxy,
		reader:reader
	});
	store.load({params:{start:0,limit:6}});
	var grid = new Ext.grid.GridPanel({
		title:'    ',
		width:600,
		collapsible:true,
		autoHeight:true,

cm:cm,
store: store,
renderTo:'mydiv',
autoExpandColumn:'memo',
buttonAlign:'center',
loadMask: {msg:' , ……'}, 
bbar:new Ext.PagingToolbar({
store:store,
pageSize:6,
displayInfo:true,
buttons:[
{text:' '},
{text:' ',menu:new Ext.menu.Menu({items:[{text:' '},{text:' '}]})}
]
})
});

});


<%@ page language="java"  pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<%
String path = request.getContextPath();
%>

<html>
	<head>
		<title>ext-02</title>
		<link rel="stylesheet" type="text/css" href="css/css/ext-all.css"/>
		<!-- <link rel="stylesheet" type="text/css" href="css/css/xtheme-access.css"/>
		 -->
		<link rel="stylesheet" type="text/css" href="css/lala.css"/>
		<script type="text/javascript" src="js/ext-base.js"></script>
		<script type="text/javascript" src="js/ext-all.js"></script>
		<script type="text/javascript" src="js/ext-lang-zh_CN.js"></script>
		<script type="text/javascript" src="js/grid.js"></script>
	</head>
	
	<body>
	
		<div id="mydiv"></div>
		
	</body>
</html>

좋은 웹페이지 즐겨찾기