日期:2014-05-16 浏览次数:20954 次
var STUDENT=Ext.data.Record.create([
{name:"sid",type:"string"},
{name:"sname"},
{name:"birthday",type:"string"},//type:"date",dataFormat:"Y-m-d"},
{name:"city",type:"string"},
{name:"stature",type:"int"}
]);
Ext.apply(Ext.form.VTypes, {
LengthLimit: function(v) {
return v.length<=10
},
LengthLimitText: "字符串长度不能大于10",
IntLimit:function(v){
return v<300;
},
IntLimitText:"身高不能大于300"
});
/********************
*表格,显示人员信息,继承自Ext.grid.GridPanel
*
********************/
StudentListGrid=Ext.extend(Ext.grid.GridPanel,{
_store:null,
_tbar:null,
_addWin:null,
_updateWin:null,
constructor:function(){
this._store=new Ext.data.JsonStore({
autoLoad:true,
url : "grid_service.jsp?action=getAllStudents",
root:"rows",
id:"id",
fields:STUDENT,
sortInfo:{field: "sid", direction: "DESC"}
});
this._tbar=new Ext.Toolbar({
id:"mainMenu",
items:["-",
{
text:"增加用户",
id:"addBtn",
iconCls:"adduser",
handler:function(){
this._addWin.show();
this._addWin._form.getForm().reset();
&n