view app/view/widgets/Uwb.js @ 413:e1af66012ef0 0.6

Reverse displayFields Array before configuring the columns of the result list. Now the displayed columns are in the same order as defined in the query configuration file.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Mon, 23 Sep 2013 14:26:09 +0200
parents cdef828f8049
children f9bb1ecf6462
line wrap: on
line source
var uwbStore = Ext.create('Ext.data.Store', {
    fields: ['umwId', 'umweltBereich'],
    sorters: [{
        property: 'umwId',
    }],
    autoLoad: true,
    proxy: {
        type: 'ajax',
        api: {
        read: 'server/rest/uwb'
        },
        reader: {
            type: 'json',
            root: 'data'
        }
    }
});

/**
 * Combobox for Umweltbereich
 */
Ext.define('Lada.view.widgets.Uwb' ,{
        tpl: '<tpl for="."><div class="x-combo-list-item  x-boundlist-item" >{umwId} - {umweltBereich}</div></tpl>',
        extend: 'Ext.form.ComboBox',
        alias: 'widget.uwb',
        store: uwbStore,
        displayField:'umwId',
        valueField: 'umwId',
        emptyText:'Wählen Sie einen Umweltbereich',
        // Enable filtering of comboboxes
        autoSelect: false,
        queryMode: 'local',
        triggerAction : 'all',
        typeAhead: true,
        minChars: 0,
        // TODO: Set value in disply after selection. Can not figure out why
        // accessing the recored.data attribute fails here (ti) <2013-08-06 16:52> 
        //listeners: {
        //    select: function(combo, record, index) {
        //        console.log("1");
        //        console.log(record);
        //        console.log("2");
        //        var text = record.data['umwId'] + " - " + record.data['umweltBereich'];
        //        console.log("3");
        //        Ext.form.ComboBox.superclass.setValue.call(this, text);
        //        combo.value = record.id;
        //    }
        //},
    initComponent: function() {
        this.callParent(arguments);
    }
});

http://lada.wald.intevation.org