cwmdream 2010-09-22 10:25
浏览 248
已采纳

关于EXT store取值显示的问题

各位大虾好,先感谢各位帮助。我先把问题说下:后台能取到值前台下面的工具条也显示取到两条数据,但是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]

显示效果如下面图片:

  • 写回答

1条回答 默认 最新

  • lizhiyezi 2010-09-22 19:41
    关注

    检查数据,和store, 很可能是数据store解析的问题

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置