日期:2014-05-16 浏览次数:20468 次
function ReportListShow(resMess){ var tempStr = setMessage(resMess); if(getFieldValue(tempStr,"erorcd",0).trim()=='0000'){ scrollBar.hide(); if(Str == "outExecl"){ return Ext.MessageBox.alert('提示','导出Excel成功!',function(){ location = "../ExportExcle.jsp?filename="+reportName+"&operid="+Fuserid; }); } var oneStr = resMess.indexOf('['); if(oneStr == -1){ return Ext.MessageBox.alert('提示','查询结果为空!'); } var twoStr = resMess.substring(0,oneStr); //第一张表记录(包含表头和对应的字段) var threeStr = resMess.substring(oneStr + 1); var frouStr = threeStr.indexOf('['); var fiveStr = threeStr.substring(0,frouStr); //第二张表记录(包含页数) var tempStrs = setMessage(fiveStr); contPages = getFieldValue(tempStrs,"totalnumber",0); countPage.setText(contPages); document.getElementById('page').value = m; if(parseInt(contPages) > 1){ downPage.enable(); } var sixStr = threeStr.substring(frouStr + 1); //第三张表记录(报表信息数据) var tableData = getParsing(setMessArray0(sixStr)); if(tableData != null){ execlRept.enable(); }else if(tableData == null){ return Ext.MessageBox.alert('提示','对不起!您输入的参数值无信息返回!'); } var tableHeadData = setMessArray(twoStr); //截取表头字符串 var gridHeader = [tableHeadData.length-1]; var readerFildeName = [tableHeadData.length-1]; for(var a=0;a<tableHeadData.length;a++){ if(a==0){ gridHeader[a] = '[{header:"'+tableHeadData[a][1]+'",sortable:true,dataIndex:"'+tableHeadData[a][0].toLowerCase()+'"}'; readerFildeName[a] = '[{name:"'+tableHeadData[a][0].toLowerCase()+'",mapping:'+a+'}'; }else if(a==tableHeadData.length-1){ gridHeader[a] = '{header:"'+tableHeadData[a][1]+'",sortable:true,dataIndex:"'+tableHeadData[a][0].toLowerCase()+'"}]'; readerFildeName[a] = '{name:"'+tableHeadData[a][0].toLowerCase()+'",mapping:'+a+'}]'; }else{ gridHeader[a] = '{header:"'+tableHeadData[a][1]+'",sortable:true,dataIndex:"'+tableHeadData[a][0].toLowerCase()+'"}'; readerFildeName[a] = '{name:"'+tableHeadData[a][0].toLowerCase()+'",mapping:'+a+'}'; } } var cm = new Ext.grid.ColumnModel(gridHeader); var readerstext = Ext.data.Record.create(readerFildeName); var repDefStore = new Ext.data.Store({ proxy:new Ext.data.MemoryProxy(tableData), reader:new Ext.data.ArrayReader({},readerstext) }) repDefStore.load(); var repDefGrid = new Ext.grid.GridPanel({ renderTo:'repShow'+(index), cm:cm, store:repDefStore, loadMask:{msg:'数据正在加载中……'}, autoHeight:true }); }else if(getFieldValue(tempStr,"erorcd",0).trim()=='9000'){ scrollBar.hide(); return Ext.MessageBox.alert('查询失败',getFieldValue(tempStr,"erortx",0)); } } 对我有用[0] 丢个板砖[0] 引用 举报 管理 TOP 回复次数:0
gridHeader = [new Ext.grid.RowNumberer(),new Ext.grid.CheckboxSelectionModel()]; readerFildeName = []; for(var a=0;a<tableHeadData.length;a++){ gridHeader.push({ header:tableHeadData[a][1], dataIndex:tableHeadData[a][0].toLowerCase(), sortable:true, renderer:gridFontColor, width:160 }) r