`
shupili141005
  • 浏览: 118771 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类

已解决往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" onclick="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;" onclick="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'}]
});

0
2
分享到:
评论
4 楼 shupili141005 2010-02-20  
Each Column in the grid's ColumnModel is configured with a dataIndex to specify how the data within each record in the store is indexed into the ColumnModel.
3 楼 shupili141005 2010-02-20  
同乐!
2 楼 202013 2010-02-10  

thanks!
1 楼 demonzyh 2009-12-09  
说明你没有看API。 哈哈。

相关推荐

    Ext.grid.ColumnModel显示不正常

    Ext.grid.ColumnModel显示不正常

    EXT grid中根据每一行的状态列内容来让当前行显示不同的背景颜色

    EXT中根据返回的grid中的状态列的内容来改变这一行显示的背景颜色

    EXT核心API详解

    69、Ext.grid.ColumnModel类 ……… 58 70、Ext.grid.PropertyColumnModel类 … 59 71、Ext.grid.GridView类 …………… 59 72、Ext.grid.GroupingView类 ………… 60 73、Ext.grid.EditorGridPanel类 ……… 62 74...

    ext可编辑表格

    ext可编辑表格Ext.onReady(function() { Ext.QuickTips.init(); //格式化日期 function formatDate(value) { return value ? value.dateFormat('Y年m月d日') : ''; } // 别名 var fm = Ext.form; //...

    ExtJS入门教程(超级详细)

    69、Ext.grid.ColumnModel类 ……… 58 70、Ext.grid.PropertyColumnModel类 … 59 71、Ext.grid.GridView类 …………… 59 72、Ext.grid.GroupingView类 ………… 60 73、Ext.grid.EditorGridPanel类 ……… 62 74...

    Ext 开发指南 学习资料

    顺便说说常见的Ext is not defined错误 A.4. 想把弹出对话框单独拿出来用的看这里 A.5. 想把日期选择框单独拿出来用的看这里 A.6. 听说有人现在还不会汉化ext A.7. 碰到使用ajax获得数据,或者提交数据出现乱码 A.8...

    JavaScript的ExtJS框架中表格的编写教程

    表格的列信息由Ext.grid.ColumnModel定义 表格的数据存储器由Ext.data.Store定义,根据解析数据的不同,数据存储器可具体分为如下几种: JsonStore,SimpleStore,GroupingStore… 一个表格的基本编写过程: 1、创建...

    Ext2.2动态生成ColumnModel

    NULL 博文链接:https://mogen9999.iteye.com/blog/262819

    JavaScript中使用sencha gridpanel 编辑单元格、改变单元格颜色

    表格的列信息由类Ext.grid.Column(以前是由Ext.grid.ColumnModel定义)、而表格的数据存储器由Ext.data.Store定义,数据存储器根据解析的数据不同分为JsonStore、SimpleStroe、GroupingStore等。 下面

    ext简单例子

    Ext.onReady(function(){ var cm = new Ext.grid.ColumnModel([ {header:'Id',dataIndex:'id'}, {header:'Name',dataIndex:'name'},

    JSP+EXt2.0实现分页的方法

    本文实例讲述了JSP+EXt2.0实现分页的...var cm = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer(), sm, {header:'编号',dataIndex:'id',sortable:true}, {header:'名称',dataIndex:'name',sortable:true},

    ExtJS 2.0 GridPanel基本表格简明教程

    ExtJS中的表格功能非常强大,包括了排序、缓存、拖动、隐藏某一列、自动显示行号、列汇总、单元格编辑等实用功能。 表格由类Ext.grid.GridPanel定义,继承自Panel,其xtype为grid。ExtJS中,表格Grid必须包含列定义...

    EXTGrid属性方法

    extjs 4.0 Grid属性方法以及常用操作,板面属性和对象

    ExtJS获取字段宽度顺序调整后的状态

    ExtJS记录字段宽度顺序状态,当用户拖动字段,修改宽度、调整顺序时可以获取调整后的顺序、宽度,

    Extjs4 GridPanel的主要配置参数详细介绍

    1、Ext.grid.GridPanel 主要配置项: store:表格的数据集 columns:表格列模式的配置数组,可自动创建ColumnModel列模式 autoExpandColumn:自动充满表格未用空间的列,参数为列id,该id不能为0 stripeRows:表格...

    extjs 学习笔记(三) 最基本的grid

    jquery在这方面则正好相反,它的UI都以插件形式提供,可以需要什么就引用什么,... 一个grid包括一些行和列,在extjs里边,列由Ext.grid.ColumnModel来管理,我们来看看如何创建一个ColumnModel对象: 代码如下: var cm

    xpTable,c# xptable NET中最强,最全功能的表格控件 ,可以定制一个ListView,能够在列中插入图像、下拉框、可上下调整的数字、进度条

    可以定制一个ListView,能够在列中插入图像、下拉框、可上下调整的数字、进度条等等。 [功能] 全定制可视化界面 支持XP风格 轻易添加再定制的控件 可隐藏列 行、列、单元可以被Disable 每个单元、列可以有Tooltip ...

    Extjs EditorGridPanel中ComboBox列的显示问题

    为了解决这个问题需要在EditorGridPanel的ColumnModel中显示ComboBox的地方使用renderer属性,重新渲染,方法如下: 代码如下: //部门列表 var comboxDepartmentStore = new Ext.data.Store({ proxy: new Ext.data....

    extjs render 用法介绍

    代码如下: var cm = new Ext.grid.ColumnModel( [ new Ext.grid.RowNumberer({ header: “”, width: 20, align: ‘center’ }), { header: ”, align: ‘center’, dataIndex: ‘AccountAndRoseID’, width: 50, ...

Global site tag (gtag.js) - Google Analytics