各位大虾好,先感谢各位帮助。我先把问题说下:后台能取到值前台下面的工具条也显示取到两条数据,但是GRID有两条数据却显示不出数据来。把代码贴上:
[code="java"]
Ext.onReady(function() {
Ext.QuickTips.init();
haveUpload();
})
function haveUpload() {
var noticeFileStore;
var noticeFileSm;
var noticeFileUrl = "/iuseoa/notice/searchNoticeFile.action";
// 附件数据源
var noticeFileList = Ext.data.Record.create({
name : "employeCode",
type : "string",
mapping : "employeCode"
}, {
name : "fileId",
type : "int",
mapping : "fileId"
}, {
name : "fileName",
type : "string",
mapping : "fileName"
}, {
name : "fileUrl",
type : "string",
mapping : "fileUrl"
}, {
name : "fileSize",
type : "float",
mapping : "fileSize"
}, {
name : "fileType",
type : "string",
mapping : "fileType"
});
noticeFileStore = getHttpProxyStore(noticeFileUrl, noticeFileList);
noticeFileStore.load({
params : {
start : 0,
limit : 8
}
});
noticeFileSm = new Ext.grid.CheckboxSelectionModel();
var noticeFileCmArray = [];
noticeFileCmArray.push(new Ext.grid.RowNumberer());
noticeFileCmArray.push(noticeFileSm);
noticeFileCmArray.push({
header : "附件编号",
width : 80,
dataIndex : "fileId",
align : "center",
sortable : true
});
noticeFileCmArray.push({
header : "附件名称",
width : 80,
dataIndex : "fileName",
align : "center",
sortable : true
});
noticeFileCmArray.push({
header : "附件地址",
width : 80,
dataIndex : "fileUrl",
align : "center",
sortable : true,
hidden : true
});
noticeFileCmArray.push({
header : "发布人编号",
width : 80,
dataIndex : "employeCode",
align : "center",
sortable : true,
hidden : true
});
// noticeFileCmArray.push({
// header : "操作",
// width : 40,
// dataIndex : '',
// align : "center",
// menuDisabled : true,
// renderer : function(value, cellmeta, record, rowIndex, columnIndex,
// store2) {
// var fileId = record.get('fileId');
// // alert(fileId);
// // alert(value+"::"+cellmeta+"::"+record+"::"+rowIndex+"::"+columnIndex+"::"+store2)
// var str = '
// + fileId + '")>';
// }
// });
var noticeFileCm = new Ext.grid.ColumnModel(noticeFileCmArray);
var noticeFileGrid = new Ext.grid.EditorGridPanel({
// autoload : true,
autoHeight : true,
autoWidth : true,
cm : noticeFileCm,
sm : noticeFileSm,
store : noticeFileStore,
frame : true,
viewConfig : {
forceFit : true
// 视图层重新计算所有列的宽度,相当于自动设置列宽!
},
bbar :
// 用来实现分页功能
new Ext.PagingToolbar({
store : noticeFileStore,
pageSize : 8,
beforePageText : '第',
afterPageText : '页,共{0}页',
displayInfo : true,
firstText : "首页",
prevText : "上一页",
nextText : "下一页",
lastText : "尾页",
refreshText : "刷新",
prependButtons : true,
displayMsg : "本页显示第{0}条到第{1}条的记录,一共{2}条",
mptyMsg : "没有记录"
})
});
var haveUploadWin = new Ext.Window({
title : "已上传附件",
width : 500,
height : 400,
resizable : false,
layout : 'fit',
mode : true,
items : [noticeFileGrid]
})
haveUploadWin.show(this);
}
[/code]
显示效果如下面图片: