extJs中一个viewport中, 使用一个请求, 同时显示两个gridPanel

viewport中代码:

examination.myPanel = new Ext.Viewport({
    layout : 'border',
    items: [{
        region: 'north',
        xtype: "panel",
        width: 800,
        items : [examination.searchFormPanel]
    },{
        title: '基本性能',
        region: 'west',
        xtype: "panel",
        width: 800,
        height: 800,
        items : [examination.grid]//[examination.searchFormPanel//
    }, {
        title: '网关性能',
        region: 'center',
        xtype: "panel",
  //      collapsible: true,
        items : [examination.gatewayGrid],
 //       split: true,
        width: 800,
        height: 800
    }]
    });

gridPanel的store代码如下:

/** cpu内存等基本信息-数据源 */
examination.store = new Ext.data.GroupingStore({
    autoLoad : false,
    remoteSort : true,
    groupField: 'type',
    proxy : new Ext.data.HttpProxy({// 获取数据的方式
    //  method : 'POST',
        type : 'jsonp',
        url : ""
    }),
    reader : new Ext.data.JsonReader({// 数据读取器
    //  totalProperty : 'total', // 记录总数
        root : 'root' // Json中的列表数据根节点
    }, [
    'ip',
    'type',
    'value',
    'time',
    'standard',
    'systemName',
    'remark'])
});
/** 网关性能信息-数据源 */
examination.gatewayStore = new Ext.data.GroupingStore({
    autoLoad : false,
    remoteSort : true,
    groupField: 'type',
    proxy : new Ext.data.HttpProxy({// 获取数据的方式
        type : 'jsonp',
        url : ""
    }),
    reader : new Ext.data.JsonReader({// 数据读取器
    //  totalProperty : '', // 记录总数
        root : 'root' // Json中的列表数据根节点
    }, [
    'ip',
    'type',
    'value',
    'time',
    'standard',
    'orderconfirmcount',
    'businessrejectcount',
    'gtljstatus',
    'systemName',
    'remark'])
});

在发送请求并获取返回值后, 在回调函数中调用下面的方法可以动态的加载两个gridPanel的数据

    examination.grid.getStore().removeAll();    //清楚grid中所有记录
    examination.gatewayGrid.getStore().removeAll();

    examination.grid.getStore().loadData(data.normalPerf);   //向grid中加载数据
    examination.gatewayGrid.getStore().loadData(data.gatewayPerf);

效果图如下:
这里写图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值