I am trying to simply load a grid panel with data from a store in my view, but I keep getting the following error:
TypeError: name is undefined
Line: if (name === from || name.substring(0, from.length) === from) {
I have experimented with how I am initializing the panel, here is what I have currently:
Ext.define('BP.view.induction.RightPage', {
extend: 'Ext.tab.Panel',
alias : 'widget.rightpage',
title: "Right Page",
items: [
{
title: 'Tasks',
html: '',
cId: 'tasksTab',
initComponent: function() {
this.add( [{
store: 'Tasks',
xtype: 'taskgrid',
hideHeaders: true,
columns: [
{
text : 'Task ID',
flex : 0,
sortable : false,
hidden : true,
dataIndex: 'id'
},
{
text : 'Task',
flex : 1,
sortable : false,
dataIndex: 'name'
},
]
}]);
this.callParent();
}
},{
title: 'Content',
html: '',
cId: 'contentTab'
}
]
});
Originally I didn't have the initComponent function, instead building items immediately - but this produced the same error.
[Edit] As requested, here is the store definition:
Ext.define('BP.store.Tasks', {
extend: 'Ext.data.Store',
requires: 'BP.model.Task',
model: 'BP.model.Task',
proxy: {
type: 'ajax',
url : '/resources/data/tasks.php',
reader: {
type:'json',
root:'tasks'
}
},
autoLoad: true
});
The full data is unwieldy, but here is a sample (json formatted):
{"success":true,
"tasks":[
{"id":1,"name":"Cleaning Products","content":"Lorem ipsum...","resource_type":"text","resource_url":"","category_id":1},
{"id":2,"name":"Preservatives","content":"Lorem ipsum...","resource_type":"text","resource_url":"","category_id":1}]
}