Mar 18, 2015, 11:11 PM
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:
extjs/ext-all-debug-js/ext.axd
at this point:
Can you help-me please ?
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.