PDA

View Full Version : [Solved] Json Combobox



Madk
7 Jul 2010, 1:35 AM
I have a combobox which work in Ext designer Preview, but give me a blank page in browser! (Error in Chrome javascript console : Cannot read property 'autoCreated' of undefined)

Any idea of what i'm doing wrong?

userStore.js

userStore = Ext.extend(Ext.data.JsonStore, {
constructor: function(cfg) {
cfg = cfg || {};
userStore.superclass.constructor.call(this, Ext.apply({
storeId: 'userStore',
url: 'http://localhost/projet/index.php/users/getUsers',
root: 'users',
autoSave: false,
fields: [
{
name: 'idPersonne',
allowBlank: false
},
{
name: 'mail',
allowBlank: false
}
]
}, cfg));
}
});
new userStore();

http://localhost/projet/index.php/users/getUsers

{"users":[{"idPersonne":"1","idProjet":"1","nom":"test","mail":"anonymous@gmail.com"}]}

blabla.ui.js :


.............
items: [
{
xtype: 'fieldset',
title: 'Choisir un utilisateur pour modification',
collapsible: true,
checkboxToggle: false,
fieldLabel: '',
items: [
{
xtype: 'combo',
forceSelection: true,
store: 'userStore',
displayField: 'mail',
valueField: 'idPersonne',
triggerAction: 'all',
lazyInit: false,
lazyRender: true,
editable: false,
submitValue: true,
allowBlank: false,
fieldLabel: 'Utilisateur',
ref: '../../../usersList',
id: 'usersList',
autoRef: 'usersList'
}
]
},
.............

Madk
7 Jul 2010, 5:28 AM
Solved : forgot to include store.js...

jarrednicholls
7 Jul 2010, 6:17 AM
Ah, great thanks for letting us know.