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 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办