Changeset 3414

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

gislars sandbox: fixed a pb with filterPanel: select event used for combobox instead of change

Files:
1 modified

Legend:

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

    r3369 r3414  
    119119        var recordIsDate = (record.get('type')=='dateTime' ||  
    120120            record.get('type')=='date'); 
     121             
     122        var onSelect = function(el, value) { 
     123            if (recordIsDate) { 
     124                var dt = new Date(value); 
     125                value = dt.format('c'); 
     126            } 
     127            this.filter.value = value; 
     128            this.fireEvent("change", this.filter); 
     129        }; 
    121130         
    122131        if (this.storeUriProperty && record.get(this.storeUriProperty)) { 
     
    139148                mode: 'local', 
    140149                width: newCmpWidth,  
    141                 triggerAction: 'all' 
     150                triggerAction: 'all', 
     151                listeners: { 
     152                    "select": onSelect, 
     153                    scope: this 
     154                } 
    142155            }, this.comboOptions)); 
    143156             
     
    156169                format: 'd/m/Y', 
    157170                allowBlank: false, 
    158                 blankText: "Ce champ est nécessaire" 
     171                blankText: "Ce champ est nécessaire", 
     172                listeners: { 
     173                    "select": onSelect, 
     174                    scope: this 
     175                } 
    159176            }); 
    160177        } else { 
     
    163180                value: '', 
    164181                allowBlank: false, 
    165                 blankText: "Ce champ est nécessaire" 
     182                blankText: "Ce champ est nécessaire", 
     183                listeners: { 
     184                    "change": onSelect, 
     185                    scope: this 
     186                } 
    166187            }); 
    167188        } 
    168         field.on('change', function(el, value) { 
    169             if (recordIsDate) { 
    170                 var dt = new Date(value); 
    171                 value = dt.format('c'); 
    172             } 
    173             this.filter.value = value; 
    174             this.fireEvent("change", this.filter); 
    175         }, this); 
    176189 
    177190        this.valueContainer.remove(previousCmp);