From 60cd42ce7894c517d3973423799338e70119785d Mon Sep 17 00:00:00 2001
From: Renaud Le Gac <legac@cppm.in2p3.fr>
Date: Tue, 4 Feb 2014 18:27:20 +0100
Subject: [PATCH] Better handling of empty value in Filter.js.

---
 languages/fr-fr.py                    | 2 +-
 static/plugin_dbui/src/grid/Filter.js | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/languages/fr-fr.py b/languages/fr-fr.py
index 31390cbe..6881bba4 100644
--- a/languages/fr-fr.py
+++ b/languages/fr-fr.py
@@ -93,7 +93,7 @@
 'select publications for a given team': 'selectionne les publications pour une équipe team',
 'select publications with a given AERES code': 'selectionne les publications avec un code AERES',
 'select publications with a given category code': 'select publications with a given category code',
-'select...': 'select...',
+'select...': 'sélectionner...',
 'Speaker': 'Orateur',
 'Start date': 'Date de début',
 'Store': 'Store',
diff --git a/static/plugin_dbui/src/grid/Filter.js b/static/plugin_dbui/src/grid/Filter.js
index 72c2356e..5a62b336 100644
--- a/static/plugin_dbui/src/grid/Filter.js
+++ b/static/plugin_dbui/src/grid/Filter.js
@@ -202,7 +202,7 @@ Ext.define('App.grid.Filter', {
             value  = field.getValue();
 
         // Clear an existing filter
-        if (filter && field.filterType === 'string' && value === "") {
+        if (Ext.isEmpty(value)) {
 
             store.removeFilter(filter);
             return;
@@ -297,11 +297,11 @@ Ext.define('App.grid.Filter', {
         }
 
         //  update the condition dictionary
-        where = field.name + " " + field.filterOperator + " '" + value + "'";
-
-        if (value === '') {
+        if (Ext.isEmpty(value)) {
             delete this.filterConditions[field.name];
+
         } else {
+            where = field.name + " " + field.filterOperator + " '" + value + "'";
             this.filterConditions[field.name] = where;
         }
 
-- 
GitLab