taylon
8 Jul 2010, 12:06 PM
Hello there. I'm hoping this is an easy fix. I'm currently trying to set up an ArrayStore but if I don't use some sort of Proxy (session or local storage) I receive the following error:
Uncaught Error: The 'memory' type has not been registered with this manager
Currently I'm just using the List example, but trying to convert it to use an array I'm pulling elsewhere instead of hardcoding like the example does.
Incidently if I do use some sort of Proxy I get the below message which I've tracked down to the fact that it appears that "loadData" doesn't appear to be using my model so my field is blank and my data in the debugger looks like
0: "Fred Flintston"
address:
Uncaught TypeError: Cannot call method 'toLowerCase' of undefined
ext-touch-debug.js:15012
Any pointers for ArrayStore would be much appreciated. Full code with a Proxy below.
var myData = [
['Fred Flintstone'],
['Barney Rubble']
];
Ext.regModel('Contact', {
fields: ['address']
});
demos.ListStore = new Ext.data.ArrayStore({
proxy: new Ext.data.SessionStorageProxy({
id: 'myProxy'
}),
fields: ['address'],
idIndex: 0,
storeId: 'MyStore',
model: 'Contact',
data: myData
});
demos.ListStore.loadData(myData);
demos.List = new Ext.Panel({
layout: Ext.platform.isPhone ? 'fit' : {
type: 'vbox',
align: 'center',
pack: 'center'
},
cls: 'demo-list',
items: [{
width: 300,
height: 500,
xtype: 'list',
store: demos.ListStore,
tpl: '<tpl for="."><div class="contact"><strong>{address}</strong></div></tpl>',
itemSelector: 'div.contact',
singleSelect: true,
grouped: false,
indexBar: true
}]
});
Uncaught Error: The 'memory' type has not been registered with this manager
Currently I'm just using the List example, but trying to convert it to use an array I'm pulling elsewhere instead of hardcoding like the example does.
Incidently if I do use some sort of Proxy I get the below message which I've tracked down to the fact that it appears that "loadData" doesn't appear to be using my model so my field is blank and my data in the debugger looks like
0: "Fred Flintston"
address:
Uncaught TypeError: Cannot call method 'toLowerCase' of undefined
ext-touch-debug.js:15012
Any pointers for ArrayStore would be much appreciated. Full code with a Proxy below.
var myData = [
['Fred Flintstone'],
['Barney Rubble']
];
Ext.regModel('Contact', {
fields: ['address']
});
demos.ListStore = new Ext.data.ArrayStore({
proxy: new Ext.data.SessionStorageProxy({
id: 'myProxy'
}),
fields: ['address'],
idIndex: 0,
storeId: 'MyStore',
model: 'Contact',
data: myData
});
demos.ListStore.loadData(myData);
demos.List = new Ext.Panel({
layout: Ext.platform.isPhone ? 'fit' : {
type: 'vbox',
align: 'center',
pack: 'center'
},
cls: 'demo-list',
items: [{
width: 300,
height: 500,
xtype: 'list',
store: demos.ListStore,
tpl: '<tpl for="."><div class="contact"><strong>{address}</strong></div></tpl>',
itemSelector: 'div.contact',
singleSelect: true,
grouped: false,
indexBar: true
}]
});