zoukankan      html  css  js  c++  java
  • 解决Ext4.2.3中propertyGrid修改后点击排序报错

    Ext4.2.3中PropertyGrid修改后点击排序报错,具体错误信息如下:

     
    一开始还怀疑是自己哪里配置错了,各种尝试结果还是一样。查遍百度和谷歌,无果,只有一篇帖子说是4.2.4修正了。还是自己动手吧,自己动手丰衣足食。
    点开报错地方(如下图所示),原来是me.field.column没有定义。
     
    然后继续找,找啊找啊找到Ext.grid.property.GridgetCellEditor方法。此方法有参数column,可在方法体内,column就没有被用到过,于是就感觉问题出在这里。
    经过实践,讲此方法修改如下,此bug就解决了。
     
        getCellEditor : function(record, column) {
            var me = this,
                propName = record.get(me.nameField),
                val = record.get(me.valueField),
                editor = me.getConfig(propName, 'editor'),
                type = me.getConfig(propName, 'type'),
                editors = me.editors;
            
            if (editor) {
                if (!(editor instanceof Ext.grid.CellEditor)) {
                    if (!(editor instanceof Ext.form.field.Base)) {
                        editor = Ext.ComponentManager.create(editor, 'textfield');
                    }
                    editor = me.setConfig(propName, 'editor', new Ext.grid.CellEditor({ field: Ext.apply(editor,{column:column}) }));
                }
            } else if (type) {
                switch (type) {
    
    
                    case 'date':
                        editor = new Ext.grid.CellEditor({ field: new Ext.form.field.Date({column: column,selectOnFocus: true})});
                        break;
                    case 'number':
                        editor = new Ext.grid.CellEditor({field: new Ext.form.field.Number({column: column,selectOnFocus: true})});
                        break;
                    case 'boolean':
                        editor = new Ext.grid.CellEditor({field: new Ext.form.field.ComboBox({column: column,
                            editable: false,
                            store: [[ true, me.headerCt.trueText ], [false, me.headerCt.falseText ]]
                        })});
                        break;
                    default:
                        editor = new Ext.grid.CellEditor({field: new Ext.form.field.Text({column: column,selectOnFocus: true})});
                }
            } else if (Ext.isDate(val)) {
                editor = new Ext.grid.CellEditor({ field: new Ext.form.field.Date({column: column,selectOnFocus: true})});
            } else if (Ext.isNumber(val)) {
                editor = new Ext.grid.CellEditor({field: new Ext.form.field.Number({column: column,selectOnFocus: true})});
            } else if (Ext.isBoolean(val)) {
                editor = new Ext.grid.CellEditor({field: new Ext.form.field.ComboBox({column: column,
                    editable: false,
                    store: [[ true, me.headerCt.trueText ], [false, me.headerCt.falseText ]]
                })});
            } else {
                editor = new Ext.grid.CellEditor({field: new Ext.form.field.Text({column: column,selectOnFocus: true})});
            }
            
            editor.editorId = propName;
            return editor;
        }
         
  • 相关阅读:
    LoadRunner系统资源监视
    Loadrunner web_url函数学习(转贴)
    Chrome的开发者工具(Chrome Developer Tools)
    浏览器对同一域名进行请求的最大并发连接数(转贴)
    转贴---Performance Counter(包含最全的Windows计数器解释)
    去掉html代码中多余琐碎的标签
    你永远不知道什么地方有笔误
    office2016开发者选项在哪?
    [VBA]检测一个中文字符串是否包含在另一个字符串中
    电子发票怎么开
  • 原文地址:https://www.cnblogs.com/erduyang/p/4576021.html
Copyright © 2011-2022 走看看