From a3974f77a872df79d004aa3eaee3b1980161738d Mon Sep 17 00:00:00 2001
From: Renaud Le Gac <legac@cppm.in2p3.fr>
Date: Fri, 22 Nov 2013 13:37:25 +0100
Subject: [PATCH] ExtJS 4.2: fixed bugs in the directstore.

---
 static/plugin_dbui/src/directstore.js | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/static/plugin_dbui/src/directstore.js b/static/plugin_dbui/src/directstore.js
index a3f87055..c12e6b11 100644
--- a/static/plugin_dbui/src/directstore.js
+++ b/static/plugin_dbui/src/directstore.js
@@ -56,10 +56,10 @@ Ext.define('App.data.DirectStore', {
         }
 
         // copy of the initial where condition
-        if (this.extraParams && this.extraParams.where) {
+        if (config.extraParams && config.extraParams.where) {
             this.initialWhere = [];
-            for (i = 0; i < this.extraParams.where.length; i += 1) {
-                this.initialWhere.push(this.extraParams.where[i]);
+            for (i = 0; i < config.extraParams.where.length; i += 1) {
+                this.initialWhere.push(config.extraParams.where[i]);
             }
         }
 
@@ -112,18 +112,20 @@ Ext.define('App.data.DirectStore', {
 
         "use strict";
 
-        var i;
+        var conditions = [],
+            i;
 
         if (this.extraParams.where) {
 
             if (this.initialWhere) {
-                this.extraParams.where = [];
+
                 for (i = 0; i < this.initialWhere.length; i += 1) {
-                    this.extraParams.where.push(this.initialWhere[i]);
+                    conditions.push(this.initialWhere[i]);
                 }
+                this.getProxy().setExtraParam('where', conditions);
 
             } else {
-                delete this.extraParams.where;
+                delete this.getProxy().extraParams.where;
             }
         }
     }
-- 
GitLab