Howto specify a Model for List
This is my JSON data returned from the server. I am not seeing my combo
getting loaded. What is wrong here?
{"suffixList":["-1","-2","-3"]}
Model:
Ext.define('ExtMVC.model.Suffix', {
    extend: 'Ext.data.Model',
    fields: [
        {name: 'suffix'}
    ]
});
Store:
 Ext.define('ExtMVC.store.Suffixes', {
        extend: 'Ext.data.Store',
        model: 'ExtMVC.model.Suffix',
        autoLoad : false,
        proxy: {
            type: 'ajax',
            url: 'http://'+window.location.host+'/populateCombo',
            reader: {
                type: 'json',
                root: 'suffixList'
            }
        }
    });
View:
{
                xtype:'combo',
                id: 'suffix',
                name: 'suffix',
                store   : 'Suffixes',
                displayField: 'suffix',
                valueField: 'suffix'
            }
 
No comments:
Post a Comment