I have the following code doing a combobox remote load/'live search' thing, mostly cribbed from the samples. The field is added to a form in a tab panel, and when I open the third panel, it blows up on the 'Ext.define' line.
If I load panels that don't contain this field, then I don't get any problems. If I close the tabs after I open them I still get the error on the third invocation.
The error occurs in Chrome (13.0.782.218) and IE8 (8.0.7601.1.17514). It doesn't occur in Firefox 6.0
If I put a breakpoint on the bad line in Chrome then it crashes the entire Chrome tab (Aw, snap, something went wrong).
Code:
Ext.define("Post", { extend: 'Ext.data.Model',
proxy: {
type: 'ajax',
url : 'api/ui/label/type.json',
reader: {
type: 'json',
root: 'items',
}
},
fields: [
{ name: 'wholeString', mapping: 'wholeString' },
{ name: 'labelName', mapping: 'labelName' }
]
});
ds = Ext.create('Ext.data.Store', {
pageSize: 0,
model: 'Post',
autoLoad: false,
data: [
{ wholeString: json.value, labelName: json.value }
]
});
var field = {
xtype: 'combo',
width: 600,
store: ds,
displayField: 'wholeString',
name: json.name,
value: json.value,
typeAhead: false,
hideTrigger: true,
fieldLabel: json.label,
listConfig: {
loadingText: 'Searching...',
emptyText: 'No labels found',
getInnerTpl: function() {
return '<div class="labelSearchResultItem"> {labelName}</div>';
}
},
pageSize: 0
};
ext-all-debug.js snippet
Code:
setWriter: function(writer) {
if (writer === undefined || typeof writer == 'string') {
writer = {
type: writer
};
}
if (!(writer instanceof Ext.data.writer.Writer)) {
Ext.applyIf(writer, {
model: this.model,
type : this.defaultWriterType
});
writer = Ext.createByAlias('writer.' + writer.type, writer); // this is line 25976
}
this.writer = writer;
return this.writer;
},
The stacktrace from Chrome:
Code:
ext-all-debug.js:25976Uncaught TypeError: Cannot read property 'type' of undefined
Ext.define.setWriterext-all-debug.js:25976
Ext.define.setModelext-all-debug.js:25919
Ext.define.constructorext-all-debug.js:25907
Base.callParentext-all-debug.js:2833
Ext.define.constructorext-all-debug.js:26100
Ext.Class.Class.newClassext-all-debug.js:3067
anonymous:2
Manager.Ext.ClassManager.instantiateext-all-debug.js:3787
Manager.Ext.ClassManager.instantiateByAliasext-all-debug.js:3737
(anonymous function)ext-all-debug.js:1521
Ext.define.inheritableStatics.setProxyext-all-debug.js:26567
data.onBeforeClassCreatedext-all-debug.js:26549
Loader.Ext.Loader.requireext-all-debug.js:4438
(anonymous function)ext-all-debug.js:1521
data.onBeforeClassCreatedext-all-debug.js:26527
Ext.Class.Class.processext-all-debug.js:3127
Ext.Class.Class.processext-all-debug.js:3132
Manager.registerPostprocessor.itemsext-all-debug.js:4672
Loader.Ext.Loader.requireext-all-debug.js:4438
Manager.registerPostprocessor.itemsext-all-debug.js:4639
Ext.Class.Class.processext-all-debug.js:3131
Ext.Class.Class.processext-all-debug.js:3132
Ext.Class.Classext-all-debug.js:3136
Manager.Ext.ClassManager.createext-all-debug.js:3668
(anonymous function)ext-all-debug.js:1521