<%@ 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">
<script type="text/javascript" src="/test/extjs/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="/test/extjs/ext-all.js"></script>
<script type="text/javascript" src="/test/extjs/ext-all-debug.js"></script>
<link rel="stylesheet" type="text/css" href="/test/extjs/resources/css/ext-all.css">
<script type="text/javascript">
Ext.onReady(function(){
var data = [
{id:1,name:'小王',sex:'男',email:'xiaowang@easyjf.com',bornDate:'1991-5-5'},
{id:1,name:'小李',sex:'男',email:'xiaoli@easyjf.com',bornDate:'1992-5-6'},
{id:1,name:'小兰',sex:'女',email:'xiaolan@easyjf.com',bornDate:'1990-2-3'}
];
var store = new Ext.data.JsonStore({
data:data,
fields:["id","name","sex","email",{name:"bornDate",type:"date",dateFormat:"Y-n-j"}]
});
var colM = new Ext.grid.ColumnModel([
{ header:"姓名",
dataIndex:"name",
sortable:true,
editor:new Ext.form.TextField()},
{ header:"性别",
dataIndex:"sex",
editor: new Ext.form.ComboBox({
transform:"sexList",
triggerAction:'all',
lazyRender:true
})},
{ header:"出生日期",
dataIndex:"bornDate",
width:120,
renderer:Ext.util.Format.dateRenderer('Y年m月d日'),
editor: new Ext.form.DateField({format:'Y年m月d日'}) },
{ header:"电子邮件",
dataIndex:"email",
sortabel:true,
editor: new Ext.form.TextField()}
]);
var grid = new Ext.grid.EditorGridPanel({
renderTo:"hello",
title:"学生基本信息管理",
height:200,
width:600,
cm:colM,
store:store,
autoExpandColumn:3,
clicksToEdit:2
});
});
</script>
</head>
<body>
<div id="hello" style="margin-left:50px; margin-top:10px; align:center;"></div>
<select id="sexList">
<option>男</option>
<option>女</option>
</select>
</body>
</html>
<html>
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="/test/extjs/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="/test/extjs/ext-all.js"></script>
<script type="text/javascript" src="/test/extjs/ext-all-debug.js"></script>
<link rel="stylesheet" type="text/css" href="/test/extjs/resources/css/ext-all.css">
<script type="text/javascript">
Ext.onReady(function(){
var data = [
{id:1,name:'小王',sex:'男',email:'xiaowang@easyjf.com',bornDate:'1991-5-5'},
{id:1,name:'小李',sex:'男',email:'xiaoli@easyjf.com',bornDate:'1992-5-6'},
{id:1,name:'小兰',sex:'女',email:'xiaolan@easyjf.com',bornDate:'1990-2-3'}
];
var store = new Ext.data.JsonStore({
data:data,
fields:["id","name","sex","email",{name:"bornDate",type:"date",dateFormat:"Y-n-j"}]
});
var colM = new Ext.grid.ColumnModel([
{ header:"姓名",
dataIndex:"name",
sortable:true,
editor:new Ext.form.TextField()},
{ header:"性别",
dataIndex:"sex",
editor: new Ext.form.ComboBox({
transform:"sexList",
triggerAction:'all',
lazyRender:true
})},
{ header:"出生日期",
dataIndex:"bornDate",
width:120,
renderer:Ext.util.Format.dateRenderer('Y年m月d日'),
editor: new Ext.form.DateField({format:'Y年m月d日'}) },
{ header:"电子邮件",
dataIndex:"email",
sortabel:true,
editor: new Ext.form.TextField()}
]);
var grid = new Ext.grid.EditorGridPanel({
renderTo:"hello",
title:"学生基本信息管理",
height:200,
width:600,
cm:colM,
store:store,
autoExpandColumn:3,
clicksToEdit:2
});
});
</script>
</head>
<body>
<div id="hello" style="margin-left:50px; margin-top:10px; align:center;"></div>
<select id="sexList">
<option>男</option>
<option>女</option>
</select>
</body>
</html>