已解决往Ext.grid.ColumnModel中附加一列,出现奇怪错误this.ds.fields.get(C) is undefined...

        以下红色代码是我后来加上去的。原来的代码运行正常,而往Grid中增加一列时,就报出this.ds.fields.get(C) is undefined (142 out of range 60)的奇怪错误。经过自己尝试之后,必须加上蓝色代码方可运行正常(Note:蓝色的两个dataIndex都必须加 ,其它方式我都尝试过了,不行啊)。

var cm = new Ext.grid.ColumnModel
([
           new Ext.grid.RowNumberer(),
        {
            header: '申请编号', dataIndex: 'applicationNO', width: 106
        }
        ,{
            header: '项目名称', id: 'projectName',dataIndex: 'projectName',tooltip: '点击项目名称即可查阅申请书', renderer: function(value,metadata,record){
             return "<a title='点击查看申请书' style='cursor:pointer;text-decoration: underline;color: #15428b;' onClick='" + "viewApplication_A(" + record.get('id') + ")'>" + value + "</a>";           
       }
        }
        ,{
            header: '计划类别', dataIndex: 'projectCateName', width: 150
        }
        ,{
            header: '管理领域', dataIndex: 'manageFieldsName', width: 72
        }
        ,{
            header: '单位名称', dataIndex: 'unitName', width: 150
        }
        ,{
            header: '负责人', dataIndex: 'principalName', width: 52
        }
        ,{
            header: '归口部门', dataIndex: 'administrator', width: 86
        }
        ,{
            header: '提交时间', dataIndex :'submitDate', width :70, renderer: Ext.util.Format.dateRenderer('Y-m-d')
        }
        ,{
            header: '附件', dataIndex: 'id' ,width: 40,fixed: true,align: 'center',renderer: function(value,metadata,record) {
            return '<a style="cursor:pointer" οnclick="viewAttachment(\'' + record.get('applicationNO') + '\')"><img src="../../images/icoImage/view.gif"></a>';
        }
        }
        ,{
            header: '操作',dataIndex: 'id' ,width: 66,fixed: true,align: 'center',renderer: function(value,metadata,record) {
            return '<a style="cursor:pointer;text-decoration: underline;color:red;" οnclick="rebuildXMLContent(\'' + record.get('id') + '\')">重新生成</a>';
        }
        }

]);
cm.defaultSortable = true;

var store = new Ext.data.JsonStore(
{        
    url: '../admin/viewApplication_AByState.action',
    totalProperty: 'recordCount',
    storeId: 'store',
    root: 'results',
    fields: ['id','applicationNO','projectName','projectCateName','unitName',
                    'principalName','administrator','manageFieldsName',
                    {name :'submitDate', type :'date', dateFormat :'Y-m-dTH:i:s'}]
});

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值