ComponentColumn generating javascript error when clicking to edir

  1. #1

    ComponentColumn generating javascript error when clicking to edit

    Hi guys,

    After update my application from 2.5 to 3.0, when I click at ComponentColumn occurs this javascript error:

    "Uncaught TypeError: Cannot use 'in' operator to search for 'xclass' in true"

    The ComponentColumn was created in controller with this code:

    private ColumnBase GetComboColumn(Att att)
            {
                return new ComponentColumn()
                {
                    Editor = true,
                    MoveEditorOnTab = true,
                    Flex = 1,
                    Component = { 
                        new ComboBox
                        {
                            QueryMode = DataLoadMode.Single,
                            Editable = true,
                            TypeAhead = true,
                            ForceSelection = true,
                            DisplayField = att.EntityRefAtt.TypeName(),
                            ValueField = "Id",
                            StoreID = att.GetStoreId()
                        }
                    }
                };
            }
    I changed script mode of ResourceManager and I could see that the error occur in file:

    extjs/ext-all-debug-js/ext.axd


    at this point:

    if ('xclass' in config) {
    that is inside this code:

    Ext.define('Ext.ComponentManager', {
        alternateClassName: 'Ext.ComponentMgr',
        
        singleton: true,
    
        count: 0,
        
        typeName: 'xtype',
    
        constructor: function(config) {
            Ext.apply(this, config || {});
            this.all = {};
            this.references = {};
            this.onAvailableCallbacks = {};
        },
        
        
        create: function (config, defaultType) {
            if (typeof config == 'string') {
                return Ext.widget(config);
            }
            if (config.isComponent) {
                return config;
            }
            
            if ('xclass' in config) {
                return Ext.create(config.xclass, config);
            }
    
            return Ext.widget(config.xtype || defaultType, config);
        },
    
        
        get: function(id) {
            return this.all[id];
        },
    
        register: function(component) {
            var me = this,
                all = me.all,
                key = component.getId(),
                onAvailableCallbacks = me.onAvailableCallbacks;
    
            if (key === undefined) {
                Ext.Error.raise('Component id is undefined. Please ensure the component has an id.');
            }
            if (key in all) {
                Ext.Error.raise('Registering duplicate component id "' + key + '"');
            }
    
            all[key] = component;
    
            if (component.reference) {
                me.references[key] = component;
            }
    
            ++me.count;
    
            onAvailableCallbacks = onAvailableCallbacks && onAvailableCallbacks[key];
            if (onAvailableCallbacks && onAvailableCallbacks.length) {
                me.notifyAvailable(component);
            }
        },
    
        unregister: function(component) {
            var id = component.getId();
    
            if (component.reference) {
                delete this.references[id];
            }
            delete this.all[id];
    
            this.count--;
        },
        
        markReferencesDirty: function() {
            this.referencesDirty = true;
        },
        
        fixReferences: function() {
            var me = this,
                references = me.references,
                key;
                
            if (me.referencesDirty) {
                for (key in references) {
                    if (references.hasOwnProperty(key)) {
                        references[key].fixReference();        
                    }
                }
                me.referencesDirty = false;
            }
        },
    
        
        onAvailable : function(id, fn, scope){
            var me = this,
                callbacks = me.onAvailableCallbacks,
                all = me.all,
                item;
    
            if (id in all) {    
                item = all[id];
                fn.call(scope || item, item);
    
            } else if (id) {    
    
                if (!Ext.isArray(callbacks[id])) {
                    callbacks[id] = [ ];
                }
                callbacks[id].push( function(item) { fn.call(scope || item, item);} );
            }
        },
    
        
        notifyAvailable : function(item) {
            var callbacks = this.onAvailableCallbacks[item && item.getId()] || [];
            while (callbacks.length) {
                (callbacks.shift())(item);
            }
        },
    
        
        each: function(fn, scope){
            return Ext.Object.each(this.all, fn, scope);
        },
    
        
        getCount: function() {
            return this.count;
        },
    
        
        getAll: function() {
            return Ext.Object.getValues(this.all);
        },
    
        deprecated: {
            5: {
                methods: {
                    
                    isRegistered: null,
    
                    
                    registerType: null
                }
            }
        }
    },
    function () {
        
        Ext.getCmp = function(id) {
            return Ext.ComponentManager.get(id);
        };
    });

    Can you help-me please ?
    Last edited by dumiranda; Mar 18, 2015 at 11:24 PM.
  2. #2
    Please post a complete (but simplified) code sample demonstrating how to reproduce the issue.

    Some more details are in our forums guidelines.
    Forum Guidelines For Posting New Topics
    More Information Required

Similar Threads

  1. Replies: 8
    Last Post: Dec 19, 2014, 10:54 PM
  2. Replies: 12
    Last Post: Jan 05, 2012, 11:39 AM
  3. Replies: 2
    Last Post: May 30, 2011, 5:53 AM
  4. Replies: 2
    Last Post: Jun 24, 2010, 7:58 PM
  5. [CLOSED] error when clicking a CheckMenuItem
    By alexp in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: May 01, 2009, 11:10 AM

Tags for this Thread

Posting Permissions