<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" xmlns="" />
<link rel="stylesheet" type="text/css" href="lib/ext/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="css/application.css" />
</head>
<script type="text/javascript" src="lib/ext/ext-base.js"></script>
<script type="text/javascript" src="lib/ext/ext-all.js"></script>
<script type="text/javascript" src="lib/ext/locale/ext-lang-zh_CN.js"></script>
<body scroll="no">
<div id="loading-mask"></div>
<div id="loading">
<div class="loading-indicator"><img alt="" src="lib/ext/resources/images/default/shared/large-loading.gif" width="32" height="32" style="margin-right:8px;" align="absmiddle"/>正在加载...</div>
</div>
<script type="text/javascript">
var app={}
Ext.onReady(function(){
Ext.BLANK_IMAGE_URL='lib/ext/resources/images/default/s.gif';
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';
Ext.Msg.minWidth=300;
app.store=new Ext.data.Store({
url:'employees_action.ashx?act=list',
baseParams:{},
reader:new Ext.data.JsonReader({
totalProperty: "results",
root:"rows",
id:"id"
},[{name: 'id',type:'int'},{name:'lastname'},{name:'firstname'},
{name:'title'},{name:'titleofcourtesy'},{name:'city'},
{name:'address'},{name:'region'},{name:'postalcode'},{name:'homephone'},{name:'country'},
{name:'birthdate',type: 'date',dateFormat:'Y-m-d'},
{name:'hiredate',type: 'date',dateFormat:'Y-m-d'}
]),
remoteSort: true
}) //store
app.pageToolbar=new Ext.PagingToolbar({
pageSize:3,displayInfo:true,store:app.store
});
app.grid=new Ext.grid.GridPanel({layout:'fit',
store:app.store, autoExpandColumn:2,tbar:app.pageToolbar,
columns:
[
{id:'id',header: "ID",width:80,dataIndex:'id',sortable: true},
{header: "FirstName",width:80, dataIndex:'firstname',sortable: true},
{header: "LastName",width:80, dataIndex:'lastname',sortable: true},
{header: "Title",width:80, dataIndex:'title',sortable: true},
{header: "Title of Courtesy",width:80, dataIndex:'titleofcourtesy',sortable: true},
{header: "City",width:80, dataIndex:'city',sortable: true},
{header: "Region",width:80, dataIndex:'region',sortable: true},
{header: "Country",width:80, dataIndex:'country',sortable: true},
{header: "Postalcode",width:80, dataIndex:'postalcode',sortable: true},
{header: "Homephone",width:80, dataIndex:'homephone',sortable: true},
{header: "Birthdate", width: 120,dataIndex:'birthdate',sortable: true,renderer:Ext.util.Format.dateRenderer('Y-m-d')},
{header: "Hiredate", width: 120,dataIndex:'hiredate',sortable: true,renderer:Ext.util.Format.dateRenderer('Y-m-d')}
]
})
var viewport = new Ext.Viewport({layout:'fit',items:[app.grid]});
app.store.load();
setTimeout(function(){
Ext.get('loading').remove();
Ext.get('loading-mask').fadeOut({remove:true});
}, 250);
})//onReady
</script>
</body>
</html>
|