Extjs Grid为何不显示
<scripttype="text/javascript">Ext.onReady(function(){//列模型varcm=newExt.grid.ColumnMod...
<script type="text/javascript">
Ext.onReady(function(){
// 列模型
var cm = new Ext.grid.ColumnModel([
{header: 'No' ,width: 30,dataIndex:'No'},
{header: '2' ,width: 120, format: 'Y-m-d', dataIndex:'workingDate'},
{header: '2' ,width:120,dataIndex:'worker'},
{header: '2' ,width: 220,dataIndex:'shortName'},
{header: '2' ,width: 120,dataIndex:'artifactAmount'},
{header: '2' , width: 100,dataIndex:'workingHour'},
{header: '2' ,width: 80, dataIndex:'unit'},
{header: '2', width: 80, dataIndex:'indicateNo'},
{header: '2' ,width: 80, dataIndex:'processCode'},
{header: '2', width: 80, dataIndex:'workDiv'},
{header: '2' , width: 80, dataIndex:'bugNo',id:'bugNo'}
]);
var data = [['1','1985-01-08','123','画面レイアウト-作成','5','20','枚','1AA00000','BD','通常','B001'],
['2','1985-01-08','123','画面レイアウト-作成','5','20','枚','1AA00000','BD','通常','B002'],
['3','1985-01-08','123','画面レイアウト-作成','5','20','枚','1AA00000','BD','通常','B003'],
['14','1985-01-08','123','画面レイアウト-作成','5','20','枚','1AA00000','BD','通常','B003'],
['15','1985-01-08','132','画面レイアウト-作成','5','20','枚','1AA00000','BD','通常','B002']
];
var proxy = new Ext.data.MemoryProxy(data);
var Human = Ext.data.Record.create([
{name:'No', type:'int', mapping:'No'},
{name:'workingDate', type:'string', mapping:'workingDate'},
{name:'worker', type:'string', mapping:'worker'},
{name:'shortName', type:'string', mapping:'shortName'},
{name:'artifactAmount', type:'string', mapping:'artifactAmount'},
{name:'workingHour', type:'string', mapping:'workingHour'},
{name:'unit', type:'string', mapping:'unit'},
{name:'indicateNo', type:'string', mapping:'indicateNo'},
{name:'processCode', type:'string', mapping:'processCode'},
{name:'workDiv', type:'string', mapping:'workDiv'},
{name:'bugNo', type:'string', mapping:'bugNo'}
]);
var reader = new Ext.data.JsonReader({},Human);
var store = new Ext.data.JsonStore({
proxy:proxy,
reader:reader,
autoLoad:true
});
var gridPanel = new Ext.grid.GridPanel({
border: false,
region: 'center',
layout: 'column',
labelWidth:65,
autoHeight: true,
labelAlign :'right',
autoScroll:true,
titleCollapse:true,
cm:cm,
store:store,
viewConfig: {
forceFit: true
}
});
</script>
<body>
<div id="form">
</body>
</html>
悬赏20分,完全按照例子来写的,为何就是不显示那,往各位前辈,指点迷经。重谢 展开
Ext.onReady(function(){
// 列模型
var cm = new Ext.grid.ColumnModel([
{header: 'No' ,width: 30,dataIndex:'No'},
{header: '2' ,width: 120, format: 'Y-m-d', dataIndex:'workingDate'},
{header: '2' ,width:120,dataIndex:'worker'},
{header: '2' ,width: 220,dataIndex:'shortName'},
{header: '2' ,width: 120,dataIndex:'artifactAmount'},
{header: '2' , width: 100,dataIndex:'workingHour'},
{header: '2' ,width: 80, dataIndex:'unit'},
{header: '2', width: 80, dataIndex:'indicateNo'},
{header: '2' ,width: 80, dataIndex:'processCode'},
{header: '2', width: 80, dataIndex:'workDiv'},
{header: '2' , width: 80, dataIndex:'bugNo',id:'bugNo'}
]);
var data = [['1','1985-01-08','123','画面レイアウト-作成','5','20','枚','1AA00000','BD','通常','B001'],
['2','1985-01-08','123','画面レイアウト-作成','5','20','枚','1AA00000','BD','通常','B002'],
['3','1985-01-08','123','画面レイアウト-作成','5','20','枚','1AA00000','BD','通常','B003'],
['14','1985-01-08','123','画面レイアウト-作成','5','20','枚','1AA00000','BD','通常','B003'],
['15','1985-01-08','132','画面レイアウト-作成','5','20','枚','1AA00000','BD','通常','B002']
];
var proxy = new Ext.data.MemoryProxy(data);
var Human = Ext.data.Record.create([
{name:'No', type:'int', mapping:'No'},
{name:'workingDate', type:'string', mapping:'workingDate'},
{name:'worker', type:'string', mapping:'worker'},
{name:'shortName', type:'string', mapping:'shortName'},
{name:'artifactAmount', type:'string', mapping:'artifactAmount'},
{name:'workingHour', type:'string', mapping:'workingHour'},
{name:'unit', type:'string', mapping:'unit'},
{name:'indicateNo', type:'string', mapping:'indicateNo'},
{name:'processCode', type:'string', mapping:'processCode'},
{name:'workDiv', type:'string', mapping:'workDiv'},
{name:'bugNo', type:'string', mapping:'bugNo'}
]);
var reader = new Ext.data.JsonReader({},Human);
var store = new Ext.data.JsonStore({
proxy:proxy,
reader:reader,
autoLoad:true
});
var gridPanel = new Ext.grid.GridPanel({
border: false,
region: 'center',
layout: 'column',
labelWidth:65,
autoHeight: true,
labelAlign :'right',
autoScroll:true,
titleCollapse:true,
cm:cm,
store:store,
viewConfig: {
forceFit: true
}
});
</script>
<body>
<div id="form">
</body>
</html>
悬赏20分,完全按照例子来写的,为何就是不显示那,往各位前辈,指点迷经。重谢 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询