PDA

View Full Version : ComboBox with Json Store



rhenkel
7 May 2010, 3:52 PM
Hi,

has anyone got it working?

Store is properly loading but nothing can be selected in the combobox.

Here is simple example. What is wrong?

Json is provided by the following srchas.php

<?php
echo '{
"srchas" : [
{
"type" : "Phrase",
"value" : "1"
},
{
"type" : "Phrase Feldanfang",
"value" : "2"
},
{
"type" : "Wort AND",
"value" : "3"
},
{
"type" : "Wort OR",
"value" : "4"
}
]
}';
?>

Thanks and Regarda

rhenkel
7 May 2010, 4:11 PM
Sorry,

the combostore.xds is obsolete.

This is the current:

jarrednicholls
8 May 2010, 8:09 PM
Hi rhenkel,

I'm assuming you're viewing this in the Preview. The Preview has some issues with Stores at the moment. This is an open issue we are working on. If you export your project and view in your own browser from your local web server...and given your "url" is setup properly...you will see that your configuration is absolutely correct and loads perfectly. The only other option you may want to change (depending on the behavior you want in the end) is to make the mode "local" instead of "remote" (the default).

rhenkel
8 May 2010, 11:23 PM
Hi jarrednicholls,

Thank you a lot. I should have had a look at this in a browser before complaining. I was actually not aware of these preview issues.

ldorr
12 May 2010, 7:38 AM
I am having the same problem and I am using a browser. I can see in firebug that my data store is loading. One thing that confuses me is that in the ui file in the combo definition, the store name has quotes around it. Any suggestions on why the combo is empty?

{
xtype: 'combo',
fieldLabel: 'Label',
anchor: '100%',
store: 'DBMethod',
valueField: 'id',
displayField: 'method'
}

aconran
12 May 2010, 9:57 AM
When you specify a storeId in your Store, it will register the Store with the StoreMgr.

You can then use a string in any store configuration to auto look it up from the StoreMgr.

Take a look at Ext.StoreMgr.lookup('DBMethod').getRange() in your console.

Are your records there?

ldorr
12 May 2010, 1:54 PM
Thanks for replying to my post! Yes, using the command you suggested I can see that the data appears to exist in the datastore at the point where my app's initComponent function is called.