view app.js @ 246:c5d7fae5997a

Change logic how to show and hide the search filters. Now we iterate over the list of defined filters for the selected query and show all matching filters. If no filter is configured at all the whole filter widget is hidden.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 23 Jul 2013 14:18:11 +0200
parents 32e1356cf391
children d80bb62b7fd4
line wrap: on
line source
Ext.application({

    // Name of the application. Do not change as this name is used in
    // references!
    name: 'Lada',

    // Setting up translations. This is done using a ext-plgin which can be
    // found on https://github.com/elmasse/Ext.i18n.Bundle
    requires: ['Ext.i18n.Bundle'],
    bundle: {
        bundle: 'Lada',
        lang: 'de-DE',
        path: 'resources',
        noCache: true
    },

    // Setting this variable to true triggers loading the Viewport.js
    // file which sets ob the viewport.
    autoCreateViewport: true,

    // Start the application.
    launch: function() {
        console.log('Launching the application');
    },

    // Define the controllers of the application. They will be initialized
    // first before the application "launch" function is called.
    controllers: [
        'Sql',
        'Proben',
        'Zusatzwerte',
        'Kommentare',
        'MKommentare',
        'Orte',
        'Messungen',
        'Messwert',
        'Status'
    ]
});

Ext.data.writer.Json.override({
    getRecordData: function(record, getEverything) {
        if(this.writeEverything || record.writeEverything){
            console.log('getRecordData', this,arguments);
            return record.getAllData();
        } else {
            return this.callOverridden(arguments);
        }
    }
});

Ext.data.Model.addMembers({
    getAllData: function() {
        var data1 = this.getData();
        var data2 = this.getAssociatedData( );
        var dataMerged = Ext.Object.merge(data1, data2);
        return dataMerged;
    },
    getEidi: function() {
        return "/" + this.getId();
    }
});

http://lada.wald.intevation.org