View Full Version : Looking for help in populating a "pull down select menu" from database

23 Mar 2011, 7:52 AM
Hi, I need help in finding ways (I know u need a PHP script that spits out JSON code) to populate a "pulldown select menu" from entries from a mysql database.

The SDK was insufficient in helping so I am asking this forum for help.

I am looking for sample codes or apps that would show me how to do it.

Tnx in advance.

24 Mar 2011, 4:51 AM
I would load that configuration when the page is rendered to the browser, or fire off the ajax request to get the information for the menu when the application bootstraps. You can use those JSON objects to populate the configuration of the pulldown menu at application run time.

24 Mar 2011, 10:05 AM
First, pull your JSON data into a store. Define and load the store before defining your form or panel that contains the selection list. Then use the "store" property in the selection list config to specify your store, e.g. let's say it's a list of countries and you pull the list out of the database into a store called "countrylist":

{xtype: 'selectfield',
name: 'country',
label: 'Country',
store: countrylist}

24 Mar 2011, 10:52 AM
Please elaborate with some code what you mean.

How do I pull JSON data into a store in the first place ??? I am looking to pull JSON data when the Card is pulled up. Some sample code? And how do I write the code of what you are describing???

thanks in advance.