首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Ajax >

GridPanel透过Ajax动态加载数据显示到页面

2012-11-01 
GridPanel通过Ajax动态加载数据显示到页面//创建查询对象var gridStore new Ext.data.JsonStore( {url :

GridPanel通过Ajax动态加载数据显示到页面

//创建查询对象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('友情提示', '数据查询异常');}}});

?

热点排行