From 7464051fdfcec4942804e40f8299f71725851541 Mon Sep 17 00:00:00 2001 From: renato Date: Thu, 19 May 2016 12:52:08 +0200 Subject: [PATCH] not contains --- controllets/filters-controllet/filters-controllet.html | 7 +++++-- datalets/base-ajax-json-alasql-datalet/static/js/AjaxJsonAlasqlBehavior.js | 2 ++ locales/controllet_ln.js | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/controllets/filters-controllet/filters-controllet.html b/controllets/filters-controllet/filters-controllet.html index bea1710..0202326 100755 --- a/controllets/filters-controllet/filters-controllet.html +++ b/controllets/filters-controllet/filters-controllet.html @@ -132,7 +132,8 @@ - + + @@ -169,7 +170,7 @@ operations : { type : Array, - value : ["=", "!=", ">", ">=", "<", "<=", "contains", "start", "ends"] + value : ["=", "!=", ">", ">=", "<", "<=", "contains", "not contains", "start", "ends"] }, filters : { @@ -257,6 +258,8 @@ }, _getOperationlName: function(operation) { + if(operation.indexOf("not") > -1) + return ln["notContains_" + ln["localization"]]; if(operation.indexOf("contains") > -1) return ln["contains_" + ln["localization"]]; if(operation.indexOf("start") > -1) diff --git a/datalets/base-ajax-json-alasql-datalet/static/js/AjaxJsonAlasqlBehavior.js b/datalets/base-ajax-json-alasql-datalet/static/js/AjaxJsonAlasqlBehavior.js index a291483..1b659a5 100755 --- a/datalets/base-ajax-json-alasql-datalet/static/js/AjaxJsonAlasqlBehavior.js +++ b/datalets/base-ajax-json-alasql-datalet/static/js/AjaxJsonAlasqlBehavior.js @@ -119,6 +119,8 @@ var AjaxJsonAlasqlBehavior = { for (var i=0; i < filters.length; i++) { if(filters[i]["operation"] == "contains") where += filters[i]["field"] + " like '%" + filters[i]["value"] + "%' AND "; + else if(filters[i]["operation"] == "not contains") + where += filters[i]["field"] + " not like '%" + filters[i]["value"] + "%' AND "; else if(filters[i]["operation"] == "start") where += filters[i]["field"] + " like '" + filters[i]["value"] + "%' AND "; else if(filters[i]["operation"] == "ends") diff --git a/locales/controllet_ln.js b/locales/controllet_ln.js index 246f0fc..9a96cd4 100755 --- a/locales/controllet_ln.js +++ b/locales/controllet_ln.js @@ -34,6 +34,7 @@ ln["filterField_en"] = "Field"; ln["filterOperation_en"] = "Operation"; ln["filterValue_en"] = "Value"; ln["contains_en"] = "contains"; +ln["notContains_en"] = "not contains"; ln["start_en"] = "start with"; ln["ends_en"] = "ends with"; @@ -148,6 +149,7 @@ ln["filterField_it"] = "Campo"; ln["filterOperation_it"] = "Operazione"; ln["filterValue_it"] = "Valore"; ln["contains_it"] = "contiene"; +ln["notContains_it"] = "non contiene"; ln["start_it"] = "inizia con"; ln["ends_it"] = "finisce con"; @@ -262,6 +264,7 @@ ln["filterField_fr"] = "Field"; ln["filterOperation_fr"] = "Operation"; ln["filterValue_fr"] = "Value"; ln["contains_fr"] = "contains"; +ln["notContains_fr"] = "not contains"; ln["start_fr"] = "start with"; ln["ends_fr"] = "ends with"; @@ -376,6 +379,7 @@ ln["filterField_nl"] = "Field"; ln["filterOperation_nl"] = "Operation"; ln["filterValue_nl"] = "Value"; ln["contains_nl"] = "contains"; +ln["notContains_nl"] = "not contains"; ln["start_nl"] = "start with"; ln["ends_nl"] = "ends with"; -- libgit2 0.21.4