PDA

View Full Version : Need a second set of Eyes



netnutmike
26 Sep 2012, 8:42 AM
Hi all,

I made what should be one simple change to a model and since I made the change I keep getting an error that says TypeError: c is not a constructor. It is not happening in the model or store but at seemingly random places in other code.

I can only assume I made some type of punctuation problem but I cannot find it and it is really short. Below is the both the model and store code. Can anyone see what I am doing wrong. This was working prior to me adding the new field to the model.

Thank You!
Mike

Model:


Ext.define('MyApp.model.MissingComponents', {
extend: 'Ext.data.Model',

fields: [
{
name: 'Date'
},
{
name: 'MissingAv',
type: 'int'
},
{
name: 'MissingBigfix',
type: 'int'
}
]
});

Store:


Ext.define('MyApp.store.MissingComponents', {
extend: 'Ext.data.Store',
requires: [
'MyApp.model.MissingComponents'
],

constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
autoLoad: true,
model: 'MyApp.model.MissingComponents',
proxy: {
type: 'ajax',
extraParams: { dataset: 'missingcomponents', days:'14' },
url: '/data/getjson.php',
timeout: 60000,
reader: {
type: 'json',
root: 'components'
}
}
}, cfg)]);
}
});

scottmartin
26 Sep 2012, 9:58 AM
What happens if you just use:




Ext.define('MyApp.store.MissingComponents', {
extend: 'Ext.data.Store',

autoLoad: true,
model: 'MyApp.model.MissingComponents',

proxy: {
type: 'ajax',
extraParams: { dataset: 'missingcomponents', days:'14' },
url: '/data/getjson.php',
timeout: 60000,
reader: {
type: 'json',
root: 'components'
}
}
});



Scott

netnutmike
26 Sep 2012, 10:04 AM
Thanks scott, just tried that and I am still getting the same error. Weird thing is I have backed out the change (new field added) and I am still getting the error.

Daniil
26 Sep 2012, 2:08 PM
Hi,

I tried to run your code and it didn't throw any error on my side.

Probably, an error occurs somewhere else.