From 09892934d506e4eb1f17ba3da1e055e5ebfac9e5 Mon Sep 17 00:00:00 2001 From: ruiy Date: Thu, 13 Jun 2019 06:44:40 +0000 Subject: [PATCH 1/4] Use instead of \ +// {{? it.settings.display_empty_filter }} \ +// \ +// {{?}} \ +// {{~ it.filters: filter }} \ +// {{? optgroup !== filter.optgroup }} \ +// {{? optgroup !== null }}{{?}} \ +// {{? (optgroup = filter.optgroup) !== null }} \ +// \ +// {{?}} \ +// {{?}} \ +// \ +// {{~}} \ +// {{? optgroup !== null }}{{?}} \ +// '; + QueryBuilder.templates.filterSelect = '\ {{ var optgroup = null; }} \ - \ + \ {{~ it.filters: filter }} \ {{? optgroup !== filter.optgroup }} \ {{? optgroup !== null }}{{?}} \ @@ -65,7 +81,8 @@ QueryBuilder.templates.filterSelect = '\ \ {{~}} \ {{? optgroup !== null }}{{?}} \ -'; +'; + QueryBuilder.templates.operatorSelect = '\ {{? it.operators.length === 1 }} \ From b649863b561d94be681219598cacd19f3c9805b3 Mon Sep 17 00:00:00 2001 From: ruiy Date: Thu, 27 Jun 2019 09:23:24 +0000 Subject: [PATCH 2/4] Enable input ability to value drop down --- src/data.js | 3 ++- src/template.js | 24 +++++++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/data.js b/src/data.js index 304f8341..6e00ea31 100644 --- a/src/data.js +++ b/src/data.js @@ -405,7 +405,8 @@ QueryBuilder.prototype.getRuleInputValue = function(rule) { value.push(tmp); } else { - value.push($value.find('[name=' + name + '] option:selected').val()); + // value.push($value.find('[name=' + name + '] option:selected').val()); + value.push($value.find('[name=' + name + ']').val()); } break; diff --git a/src/template.js b/src/template.js index a21ebcf8..1b5d5864 100644 --- a/src/template.js +++ b/src/template.js @@ -83,7 +83,6 @@ QueryBuilder.templates.filterSelect = '\ {{? optgroup !== null }}{{?}} \ '; - QueryBuilder.templates.operatorSelect = '\ {{? it.operators.length === 1 }} \ \ @@ -104,9 +103,28 @@ QueryBuilder.templates.operatorSelect = '\ {{? optgroup !== null }}{{?}} \ '; +// QueryBuilder.templates.ruleValueSelect = '\ +// {{ var optgroup = null; }} \ +// '; + QueryBuilder.templates.ruleValueSelect = '\ {{ var optgroup = null; }} \ - \ + \ {{? it.rule.filter.placeholder }} \ \ {{?}} \ @@ -120,7 +138,7 @@ QueryBuilder.templates.ruleValueSelect = '\ \ {{~}} \ {{? optgroup !== null }}{{?}} \ -'; +'; /** * Returns group's HTML From 01821cab025322a76e949e81edad617be30e6994 Mon Sep 17 00:00:00 2001 From: ruiy Date: Fri, 28 Jun 2019 06:52:39 +0000 Subject: [PATCH 3/4] Case sensitive for string type filter which input is text --- src/plugins/sql-support/plugin.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/sql-support/plugin.js b/src/plugins/sql-support/plugin.js index 95b7eda5..9e11a5eb 100644 --- a/src/plugins/sql-support/plugin.js +++ b/src/plugins/sql-support/plugin.js @@ -343,7 +343,9 @@ QueryBuilder.extend(/** @lends module:plugins.SqlSupport.prototype */ { */ var field = self.change('getSQLField', rule.field, rule); - var ruleExpression = field + ' ' + sqlFn(value); + var ruleExpression = rule.type === 'string' && rule.input === 'text' ? + 'UPPER(' + field + ')' + sqlFn('UPPER(' + value + ')') : + field + ' ' + sqlFn(value); /** * Modifies the SQL generated for a rule From c25302d5f939fb8ed4e59334fd8f983883f7d65b Mon Sep 17 00:00:00 2001 From: ruiy Date: Mon, 1 Jul 2019 05:57:57 +0000 Subject: [PATCH 4/4] case sensitive for select value --- src/plugins/sql-support/plugin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/sql-support/plugin.js b/src/plugins/sql-support/plugin.js index 9e11a5eb..d8de997f 100644 --- a/src/plugins/sql-support/plugin.js +++ b/src/plugins/sql-support/plugin.js @@ -343,8 +343,8 @@ QueryBuilder.extend(/** @lends module:plugins.SqlSupport.prototype */ { */ var field = self.change('getSQLField', rule.field, rule); - var ruleExpression = rule.type === 'string' && rule.input === 'text' ? - 'UPPER(' + field + ')' + sqlFn('UPPER(' + value + ')') : + var ruleExpression = rule.type === 'string' && (rule.input === 'text' || rule.input === 'select') ? + 'LOWER(' + field + ')' + sqlFn('LOWER(' + value + ')') : field + ' ' + sqlFn(value); /**