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分,完全按照例子来写的,为何就是不显示那,往各位前辈,指点迷经。重谢
展开
 我来答
小豆526
2010-07-08 · TA获得超过165个赞
知道小有建树答主
回答量:165
采纳率:0%
帮助的人:144万
展开全部
1,在grid中添加renderTo:“form”
2,在js结尾添加
gridPanel.render("form");
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式