在写extjs中一个panel里放了3个grid,但就是不显示页面,后台给出数据,前台也有加载数据

Ext.BLANK_IMAGE_URL = 'ext3/resources/images/default/s.gif"';
Ext.onReady(function(){
var id='<%=request.getParameter("id")%>';
var listurl = "task!topology_stats.action?task.id="+id;


var dstopostats = new Ext.data.Store({
/* proxy : new Ext.data.HttpProxy({
url : listurl
}), */
//proxy也不需要了
reader : new Ext.data.JsonReader({
//root : "sysList",
//root也不需要了
id : 'id',
fields : [{
name : 'windowPretty',
type : 'String',
mapping : 'windowPretty'
},{
name : 'emitted',
type : 'String',
mapping : 'emitted'
}, {
name : 'transferred',
type : 'string',
mapping : 'transferred'
}, {
name : 'completeLatency',
type : 'string',
mapping : 'completeLatency'
},
{
name : 'acked',
type : 'String',
mapping : 'acked'
},
{
name : 'failed',
type : 'String',
mapping : 'failed'
}]
})

});
//dssys.load();
//dssys.loadData(resultData1);


//加载数据,storm supervisor summary

var dsspouts = new Ext.data.Store({
/* proxy : new Ext.data.HttpProxy({
url : listurl
}), */
reader : new Ext.data.JsonReader({
//root : 'hadoopList',
id : 'id',
fields : [{
name : 'spoutId',
type : 'string',
mapping : 'spoutId'
}, {
name : 'executors',
type : 'string',
mapping : 'executors'
}, {
name : 'tasks',
type : 'string',
mapping : 'tasks'
},
{
name : 'emitted',
type : 'String',
mapping : 'emitted'
},
{
name : 'transferred',
type : 'String',
mapping : 'transferred'
},
{
name : 'completeLatency',
type : 'String',
mapping : 'completeLatency'
},
{
name : 'acked',
type : 'String',
mapping : 'acked'
},
{
name : 'failed',
type : 'String',
mapping : 'failed'
},
{
name : 'errorHost',
type : 'String',
mapping : 'errorHost'
},
{
name : 'errorPort',
type : 'String',
mapping : 'errorPort'
},
{
name : 'lastError',
type : 'String',
mapping : 'lastError'
}]
})

});

var dsbolts = new Ext.data.Store({
/* proxy : new Ext.data.HttpProxy({
url : listurl
}), */
reader : new Ext.data.JsonReader({
//root : 'hadoopList',
id : 'id',
fields : [{
name : 'boltId',
type : 'string',
mapping : 'boltId'
}, {
name : 'executors',
type : 'string',
mapping : 'executors'
}, {
name : 'tasks',
type : 'string',
mapping : 'tasks'
},
{
name : 'emitted',
type : 'String',
mapping : 'emitted'
},
{
name : 'transferred',
type : 'String',
mapping : 'transferred'
},
{
name : 'capacity',
type : 'String',
mapping : 'capacity'
},
{
name : 'executeLatency',
type : 'String',
mapping : 'executeLatency'
},
{
name : 'executed',
type : 'String',
mapping : 'executed'
},
{
name : 'processLatency',
type : 'String',
mapping : 'processLatency'
},
{
name : 'acked',
type : 'String',
mapping : 'acked'
},
{
name : 'failed',
type : 'String',
mapping : 'failed'
},
{
name : 'errorHost',
type : 'String',
mapping : 'errorHost'
},
{
name : 'errorPort',
type : 'String',
mapping : 'errorPort'
},
{
name : 'lastError',
type : 'String',
mapping : 'lastError'
}]
})

});
//分发数据
Ext.Ajax.request({
url : listurl,
async:false,
method:"get",
success : function(response) {
var result=Ext.util.JSON.decode(response.responseText);
resultData1 =result.taskList;
//下面分发数据
dstopostats.loadData(result.topology_statsList);
dsspouts.loadData(result.spoutList);
dsbolts.loadData(result.boltList);
},
failure : function() {
Ext.MessageBox.alert("失败", "请求数据失败");
}
});

//
var coltopostats = new Ext.grid.ColumnModel({
columns : [{
header : "Window",
width : 120,
dataIndex:'windowPretty',
sortable : true
},
// {header:"id",width:120,dataIndex:'id',sortable:true},
{
header : "Emitted",
width : 180,
dataIndex : 'emitted',
}, {
header : "Transferred",
width : 120,
dataIndex : 'transferred',
}, {
header : "Complete Latency",
width : 120,
dataIndex : 'completeLatency',
},{
header : "Acked",
width : 120,
dataIndex : 'acked',
sortable : true
}, {
header : "Failed",
width : 120,
dataIndex : 'failed',
//renderer : getDetail,
sortable : true
}
]
});

// server数据表列模式,hadoop1.0
var colspouts = new Ext.grid.ColumnModel({
columns : [{
header : "Id",
width : 280,
dataIndex : 'id',
},
// {header:"id",width:120,dataIndex:'id',sortable:true},
{
header : "executors",
width : 120,
dataIndex : 'executors',
}, {
header : "tasks",
width : 120,
dataIndex : 'tasks',
}, {
header : "emitted",
width : 120,
dataIndex : 'emitted',
}, {
header : "transferred",
width : 120,
dataIndex : 'transferred',
}, {
header : "completeLatency",
width : 120,
dataIndex : 'completeLatency',
}, {
header : "acked",
width : 120,
dataIndex : 'acked',
},{
header : "failed",
width : 120,
dataIndex : 'failed',
}, {
header : "errorHost",
width : 120,
dataIndex : 'errorHost',
}, {
header : "errorPort",
width : 120,
dataIndex : 'errorPort',
}, {
header : "lastError",
width : 120,
dataIndex : 'lastError',
}]
});


// server数据表列模式,hadoop1.0
var colbolts = new Ext.grid.ColumnModel({
columns : [{
header : "Id",
width : 280,
dataIndex : 'boltId',
},
// {header:"id",width:120,dataIndex:'id',sortable:true},
{
header : "Executors",
width : 120,
dataIndex : 'executors',
}, {
header : "Tasks",
width : 120,
dataIndex : 'tasks',
}, {
header : "Emitted",
width : 120,
dataIndex : 'emitted',
}, {
header : "Transferred",
width : 120,
dataIndex : 'transferred',
}, {
header : "Capacity",
width : 120,
dataIndex : 'capacity',
}, {
header : "Execute Latency",
width : 120,
dataIndex : 'executeLatency',
}, {
header : "Executed",
width : 120,
dataIndex : 'executed',
}, {
header : "Process Latency",
width : 120,
dataIndex : 'processLatency',
}, {
header : "Acked",
width : 120,
dataIndex : 'acked',
}, {
header : "Failed",
width : 120,
dataIndex : 'failed',
}, {
header : "ErrorHost",
width : 120,
dataIndex : 'errorHost',
}, {
header : "ErrorPort",
width : 120,
dataIndex : 'errorPort',
}, {
header : "LastError",
width : 120,
dataIndex : 'lastError',
}]
});






// 资源相关的表信息
var topostatsview = new Ext.grid.EditorGridPanel({
            title:"Topology stats",
store : dstopostats,
id:'topostatsview',
enableColumnMove : false,
columnLines : true,
enableHdMenu : false,
height : 150,
width : 1700,
cm : coltopostats
//renderTo:"topostatspanel"
});
console.warn("topostatsview:"+topostatsview);

var spoutsview = new Ext.grid.EditorGridPanel({
            title:"Spouts(All time)",
store : dsspouts,
id:'spoutsview',
enableColumnMove : false,
columnLines : true,
enableHdMenu : false,
height : 150,
width : 2500,
cm : colspouts

});
console.warn("spoutsview:"+spoutsview);

var boltsview = new Ext.grid.EditorGridPanel({
            title:"Bolts (All time)",
store : dsbolts,
enableColumnMove : false,
columnLines : true,
enableHdMenu : false,
height : 150,
width : 2500,
cm : colbolts
});
console.warn("boltsview:"+boltsview);

var topostatspanel = new Ext.Panel({
id : 'topostatspanel',
//region : 'center',
frame : true,
//title : '表单例子',
autoScroll : true,
//layout:"form",
margins : '0 5 5 1',
items : [topostatsview,
spoutsview,boltsview],
//items : [sysinfo],
renderTo:"topostatspanel"

});

});

</script>
  
  <body>
   <!--  This is my JSP page. <br> -->
   <div id = "topostatspanel"></div>
  </body>
</html>


本以为是grid中的数据名,或类型写错,通过每个grid单独测试,都能显示出页面,说明grid是没问题的,后来把renderTo:"topostatspanel"改成renderTo:"topo"页面就好了,遇到这个问题两次了,虽然不知道问什么不能和panel的名字一样

  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值