日期:2014-05-16 浏览次数:20801 次
//创建查询对象
var gridStore = new Ext.data.JsonStore( {
url : "../../service/vip/query.action",
autoLoad : false,
pruneModifiedRecords : true,
fields : [ 'IMSI', 'MSISDN', 'zjshcount'],
root : 'data',
method : 'POST'
});
//数据加载
gridStore.load();
//创建表格对象,显示查询出来的数据
var grid = new Ext.grid.GridPanel( {
el : "gridDiv",
store : gridStore,
columns : [
{id : 'IMSI', header : 'IMSI', dataIndex : 'IMSI', sortable : true},
{id : 'MSISDN', header : 'MSISDN', dataIndex : 'MSISDN', sortable : true},
{id : 'zjshcount', header : '主叫试呼次数', dataIndex : 'zjshcount', sortable : true}
],
viewConfig : {
forceFit : true
},
autoHeight : true,
width : 900
});
//加载到页面
grid.render();
?
//带参数的后台访问加载
//点击查询按钮后根据查询条件加载查询结果
grid.getStore().load( {
params : {
starttime : starttimeValue,
endtime : endtimeValue,
type : type_comboBox.getValue(),
province : province.getValue(),
city : city.getValue(),
zdvip : zdvip.checked,
continutime : continutime.getValue(),
continutime2 : continutime2.getValue(),
opc : opc.getValue(),
opc2 : opc2.getValue()
},
callback : function(r, options, success) {
if (success) {
//加载成功后显示到页面
grid.render();
} else {
Ext.Msg.alert('友情提示', '数据查询异常');
}
}
});
?