回复 10楼 wangnannan
感觉跟我现在写EXTJS的表格的风格差不多
我的标准页面格式,这样写比用EXT那种风格要容易掌握
<html xmlns="http://www.
<head>
<title>titleName</title>
//各类引用
<script type="text/javascript">
function go() {
= Ext.get("tabDIV");
//这里放所有的公共变量
this.init();
}
go.prototype.init = function () {
//这里放页面数据格式
var url = urlString;
var dhp = new Ext.data.HttpProxy({ url: url, method: "GET" });
var djr= new Ext.data.JsonReader({
root: 'data',
totalProperty: 'totalPageCount',
fields: ["data1","data2","data3"]
});
this.gridStore = new Ext.data.GroupingStore({
proxy: dhp,
reader: djr,
sortInfo: {field: "data1", direction: "ASC"}
});
this.createwin
}
go.prototype.createwin= function () {
//这里写整个页面的界面
this.searchBtn = new Ext.Button({ text: "按键" });
this.tabgrid = new Ext.grid.GridPanel({
store: this.gridStore,
selModel: new Ext.grid.RowSelectionModel({ singleSelect: false }),
columns: [
new Ext.grid.RowNumberer({ width: 30 }),
{ header: "字段1", sortable: true, align: "right", width: 60, dataIndex: 'filecarnumber' },
{ header: "字段2", sortable: true, align: "right", width: 60, dataIndex: 'cargoupname' },
{ header: "字段3", sortable: true, align: "left", width: 60, dataIndex: 'cartypename' }
],
view: new Ext.grid.GridView({
autoFill: false,
sortAscText: '正向排序',
sortDescText: '反向排序',
columnsText: '显示列/隐藏列'
}),
height: (),
width: (),
frame: false,
border: false,
hideMode: "display",
autoScroll: true,
tbar: [this.searchBtn],
renderTo: "tabDIV",
loadMask: { msg: '数据加载中...' }
});
this.eventwin
}
go.prototype.eventwin= function () {
//最后这里是汇集页面所有的事件
this.searchBtn .addListener("click", function () {
this.gridStore.load({});
}, this);
}
Ext.onReady(function () {
var go = new go();
});
</script>
</head>
<body>
<div id='tabDIV' style='width:100%;height:100%;'></div>
</body>
</html>