主要只有两个页面 一个是login.jsp 一个是query.jsp(手动加入数据) 两个页面单独运行没有问题
login.jsp嵌入的js
Ext.onReady(function(){
Ext.QuickTips.init();
var simple = new Ext.FormPanel({
labelWidth: 75, // label settings here cascade unless overridden
frame:true,
title: 'Simple Form',
bodyStyle:'padding:5px 5px 0',
width: 350,
defaults: {width: 230},
defaultType: 'textfield',
items: [{
fieldLabel: 'First Name',
name: 'first',
allowBlank:false
},{
fieldLabel: 'Last Name',
name: 'last'
},{
fieldLabel: 'Company',
name: 'company'
}, {
fieldLabel: 'Email',
name: 'email',
vtype:'email'
}, new Ext.form.TimeField({
fieldLabel: 'Time',
name: 'time',
minValue: '8:00am',
maxValue: '6:00pm'
})
],
buttons: [{
text: '提交',
handler:function(){
simple.getForm().submit({url:'test!login',waitMsg:'Login ing'})
}
},{
text: '重置',
handler:function(){
simple.form.reset();
}
}]
});
simple.render(document.body)
});
query.jsp 的js
Ext.onReady(
function(){
//创建测试数据
var testData=[
['Apple',30.0,0.24,0.9,'9/1 12:00am'],
['hp',30.0,0.24,0.9,'9/1 12:00am'],
['lennovo',30.0,0.24,0.9,'9/1 12:00am']
];
//创建数据store
var store=new Ext.data.ArrayStore({
fields:[
{name: 'company'},
{name: 'price', type: 'float'},
{name: 'change', type: 'float'},
{name: 'pctChange', type: 'float'},
{name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
]
});
//读取测试数据
store.loadData(testData);
//创建Grid
//加载store
//规定列属性
var grid=new Ext.grid.GridPanel({
store:store,
columns: [
{
id :'company',
header : 'Company',
width : 160,
sortable : true,
dataIndex: 'company'
},
{
header : 'Price',
width : 75,
sortable : true,
dataIndex: 'price'
},
{
header : 'Change',
width : 75,
sortable : true,
dataIndex: 'change'
},
{
header : '% Change',
width : 75,
sortable : true,
dataIndex: 'pctChange'
},
{
header : 'Last Updated',
width : 85,
sortable : true,
renderer : Ext.util.Format.dateRenderer('m/d/Y'),
dataIndex: 'lastChange'
}
],
stripeRows: true,
autoExpandColumn: 'company',
height: 350,
width: 600,
title: 'Array Grid'
});
grid.render('aaa');
});
只要一跳转 就会出现
30ms
syntax error