PDA

View Full Version : combobox problem



nick saint
11 Jun 2009, 1:45 PM
Hi, I have a problem with combobox.
The code is

var mainSS = new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({url: '<?= HTTP_SERVER;?>json/settings/allSuplList.php' }),
reader: new Ext.data.JsonReader({
id: 'allCntrList',
totalProperty: 'total',
root:'students'
}, [{name: 'name'}, {name: 'id'}])
});

var mainS = new Ext.form.ComboBox({
store: mainSS,
hiddenId: 'id',
hiddenName: 'suplId',
tpl: '<tpl for=\".\"><div ext:qtip=\"{name}\" class=\"x-combo-list-item\">{name}</div></tpl>',
displayField:'name',
valueField: 'id',
fieldLabel: 'Students',
emptyText:'Select...',
loadingText: 'Loading...',
maxHeight: 100,
allowBlank: false,
editable:false,
anchor:'100%',
triggerAction: 'all',
lazyRender:true,
forceSelect: true,
listClass: 'x-combo-list-small'
});
I definitely know that the store is getting the data.


{students: [
{ name:'Ivan J', id:'17'},
{ name:'Anna H', id:'6'},
{ name:'Nick F', id:'4'}
]}
With the previous EXT version everything was ok but since ext-3.0-rc2 I had a few things I really do not understand.
Please, help to solve this one.
Nick

tryanDLS
11 Jun 2009, 2:12 PM
"Have a problem with Combobox" doesn't tell us anything.

Please review the JsonStore doc - there is no reader config. A JsonReader is internally configured.

nick saint
12 Jun 2009, 12:08 AM
Hi, thank you for reply.
You were right I had a few thing wrong. The store now is like this


var store = new Ext.data.JsonStore({
// store configs
//autoDestroy: true,
url: '<?= HTTP_SERVER;?>json/settings/allSuplList.php',
storeId: 'allCntrList',
// reader configs
root: 'students',
idProperty: 'name',
fields: ['name', 'id']
});

But a combo still does not work. I have read the JsonStore docs. The server returns the right type of data. Console confirms the data relieved.
Please, helpl to get it running.
Thank you
Nick

nick saint
12 Jun 2009, 3:06 AM
Someone, please...

nick saint
13 Jun 2009, 12:23 AM
I found the problem. The old version does work but I couldn't see the selector items list. The thing is that the list appears behind the window. As I said I was using the desktop interface and I had something similar with window z-indexes. In the forum I have found this: Ext.WindowMgr.zseed = 50000;.
Is there any way to do the same with combo list items?
Thank you
Nick