Changeset 3417

Show
Ignore:
Timestamp:
03/12/10 14:17:32 (2 years ago)
Author:
fvanderbiest
Message:

gislars sandbox: filterPanel.js

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • sandbox/gislars/sipv/MapFish/client/mfbase/styler/lib/Styler/widgets/FilterPanel.js

    r3416 r3417  
    120120            record.get('type')=='date'); 
    121121         
    122         var onSelect = function(el, record) { 
    123             var value = record.get('value'); 
     122        var onChange = function(el, value) { 
     123            if (value instanceof Ext.data.Record) { 
     124                value = value.get('value'); 
     125            } 
    124126            if (recordIsDate) { 
    125127                var dt = new Date(value); 
     
    149151                mode: 'local', 
    150152                width: newCmpWidth,  
    151                 triggerAction: 'all' 
     153                triggerAction: 'all', 
     154                listeners: { 
     155                    'select': onChange, 
     156                    'change': onChange, 
     157                    scope: this 
     158                } 
    152159            }, this.comboOptions)); 
    153             field.on('select', onSelect, this); 
    154160             
    155161            store.on('load', function(store, records){ 
     
    167173                format: 'd/m/Y', 
    168174                allowBlank: false, 
    169                 blankText: "Ce champ est nécessaire" 
     175                blankText: "Ce champ est nécessaire", 
     176                listeners: { 
     177                    'select': onChange, 
     178                    'change': onChange, 
     179                    scope: this 
     180                } 
    170181            }); 
    171             field.on('select', onSelect, this); 
     182             
    172183        } else { 
    173184            var field = new Ext.form.TextField({ 
     
    177188                blankText: "Ce champ est nécessaire" 
    178189            }); 
    179             field.on('change', function(el, value) { 
    180                 this.filter.value = value; 
    181                 this.fireEvent("change", this.filter); 
    182             }, this); 
     190            field.on('change', onChange, this); 
    183191        } 
    184192