0
votes

I am no JS star so I'm having trouble finding a solution to something that is probably easier than I know.

the page loads, but the ui content stops when it hits the ui code to load the static store data. The preexisting project uses dynamically grabbed data from the database but this just needs a small list of options. (I miss the days of just using HTML). Firebug shows a non-helpful error in ext-all.js that q is undefined, but since that's obfuscated well maintained code I'm sure it's a problem in my code. Do I need to define the proxy for this even if it's static data? Thank you ahead of time!

Here is the model, store, and ui code

//model
Ext.define('HITS.model.ComboBox', {
    extend: 'Ext.data.Model',
    fields: [
            {type: 'string', name: 'label', mapping: 'label'},
            {type: 'string', name: 'value', mapping: 'value'}
     ]
});

//store
Ext.define('HITS.store.ReportType', {
    extend: 'Ext.data.Store',
    model: 'HITS.model.ComboBox',
    storeId:'ReportType',
    data: [
            {label:'All Tags',      value: 'AllTags'},
            {label:'Key Findings',  value: 'KeyFindings'}
        ]
});

//ui
    <ui:ComboBox
        renderTo="ui_report_list"
        fieldLabel="Report:"
        inputId="reportSelect"
        store="ReportType">
1

1 Answers

0
votes

The solution had a couple of changes required. The first was the "value" column, which is of course a reserved word in the database(oracle). The other was because I didn't add some prefunction comments for the model that trigger autogenerated code(I hate this practice).

The code here should mostly work but you'd need the model I ended up using. If you check sencha and don't use reserved words you should be ok.