View Full Version : jsonReader ComboBox Question

18 Jul 2009, 11:45 AM
I am very new to EXT JS, so first off I want to express my gratitude to anyone who takes the time to respond.

I bought the book "Learning Ext JS" by
Colin Ramsay (http://www.packtpub.com/author_view_profile/id/270), Shea Frederick (http://www.packtpub.com/author_view_profile/id/269), Steve 'Cutter' Blades (http://www.packtpub.com/author_view_profile/id/271) and in the book they give an incomplete example of populating a combobox with a JSON data feed from a PHP server. I have been attempting to recreate this example but I am having no success at it. There is a catch, I am not using a PHP server. I am using a coldfusion 8 server. I wrote a static .cfm template (chap3PHPformatedData.cfm) to return the following PHP formated json data set:


The script that call the dataset looks like this:

Ext.BLANK_IMAGE_URL = '../images/s.gif';

var genres = new Ext.data.Store({
reader: new Ext.data.JsonReader({
fields: ['id', 'genre_name'],
root: 'rows'
proxy: new Ext.data.HttpProxy({
url: 'data/chap3PHPformatedData.cfm'
autoLoad: true

new Ext.FormPanel({
url: 'movie-form-submit.cfm',
renderTo: document.body,
frame: true,
title: 'Movie Information Form',
width: 250,
items: [{
xtype: 'combo',
name: 'genre',
fieldLabel: 'Genre',
mode: 'local',
store: genres,
valueField: 'id',
width: 130,
triggerAction: 'all',
emptyText: 'Select a state...'

The Ajax call seems to work and I can view the response text in firebug, but the combo box does not populate the drop down options.

Thank you for your help.
Steven Benjamin

18 Jul 2009, 12:22 PM


fields: ['id', 'genre_name'],


18 Jul 2009, 1:11 PM
That was the problem :)