Commit 70505698 authored by GoshaZotov's avatar GoshaZotov Committed by Alexander.Trofimov

changed function CustomFilter.prototype.isHideValue

parent a2687c6e
...@@ -5665,105 +5665,163 @@ CustomFilter.prototype.isHideValue = function(val) { ...@@ -5665,105 +5665,163 @@ CustomFilter.prototype.isHideValue = function(val) {
var result = false; var result = false;
var isDigitValue = isNaN(val) ? false : true; var isDigitValue = isNaN(val) ? false : true;
if(!isDigitValue) if(!isDigitValue)
{
val = val.toLowerCase(); val = val.toLowerCase();
var checkComplexSymbols = null; }
var filterVal, position;
var checkComplexSymbols = null, filterVal;
if(checkComplexSymbols != null) if(checkComplexSymbols != null)
{
result = checkComplexSymbols; result = checkComplexSymbols;
}
else else
{ {
if(this.Operator == c_oAscCustomAutoFilter.equals || this.Operator == c_oAscCustomAutoFilter.doesNotEqual)//общие для числа и текста var isNumberFilter = this.Operator == c_oAscCustomAutoFilter.isGreaterThan || this.Operator == c_oAscCustomAutoFilter.isGreaterThanOrEqualTo || this.Operator == c_oAscCustomAutoFilter.isLessThan || this.Operator == c_oAscCustomAutoFilter.isLessThanOrEqualTo;
if(c_oAscCustomAutoFilter.equals === this.Operator || c_oAscCustomAutoFilter.doesNotEqual === this.Operator)
{ {
filterVal = isNaN(this.Val) ? this.Val.toLowerCase() : this.Val; filterVal = isNaN(this.Val) ? this.Val.toLowerCase() : this.Val;
if (this.Operator == c_oAscCustomAutoFilter.equals)//equals
{
if(val == filterVal)
result = true;
} }
else if (this.Operator == c_oAscCustomAutoFilter.doesNotEqual)//doesNotEqual else if(isNumberFilter)
{ {
if(val != filterVal) if(isNaN(this.Val))
result = true; {
} return !result;
} }
else if((this.Operator == c_oAscCustomAutoFilter.isGreaterThan ||this.Operator == c_oAscCustomAutoFilter.isGreaterThanOrEqualTo || this.Operator == c_oAscCustomAutoFilter.isLessThan || this.Operator == c_oAscCustomAutoFilter.isLessThanOrEqualTo) && !isNaN(this.Val))//только для чисел else
{ {
filterVal = parseFloat(this.Val); filterVal = parseFloat(this.Val);
val = parseFloat(val); val = parseFloat(val);
}
}
else
{
filterVal = isNaN(this.Val) ? this.Val.toLowerCase() : this.Val;
}
switch (this.Operator) switch (this.Operator)
{ {
case c_oAscCustomAutoFilter.isGreaterThan: case c_oAscCustomAutoFilter.equals://equals
if(val > filterVal)//isGreaterThan {
if(val === filterVal)
{
result = true; result = true;
}
break; break;
case c_oAscCustomAutoFilter.isGreaterThanOrEqualTo: }
if(val >= filterVal)//isGreaterThanOrEqualTo case c_oAscCustomAutoFilter.doesNotEqual://doesNotEqual
{
if(val !== filterVal)
{
result = true; result = true;
}
break; break;
case c_oAscCustomAutoFilter.isLessThan: }
if(val < filterVal)//isLessThan
case c_oAscCustomAutoFilter.isGreaterThan://isGreaterThan
{
if(val > filterVal)
{
result = true; result = true;
}
break; break;
case c_oAscCustomAutoFilter.isLessThanOrEqualTo: }
if(val <= filterVal)//isLessThanOrEqualTo case c_oAscCustomAutoFilter.isGreaterThanOrEqualTo://isGreaterThanOrEqualTo
{
if(val >= filterVal)
{
result = true; result = true;
}
break; break;
} }
case c_oAscCustomAutoFilter.isLessThan://isLessThan
{
if(val < filterVal)
{
result = true;
}
break;
} }
else if(this.Operator == c_oAscCustomAutoFilter.beginsWith || this.Operator == c_oAscCustomAutoFilter.doesNotBeginWith || this.Operator == c_oAscCustomAutoFilter.endsWith || this.Operator == c_oAscCustomAutoFilter.doesNotEndWith || this.Operator == c_oAscCustomAutoFilter.contains || this.Operator == c_oAscCustomAutoFilter.doesNotContain)//только для текста case c_oAscCustomAutoFilter.isLessThanOrEqualTo://isLessThanOrEqualTo
{ {
filterVal = isNaN(this.Val) ? this.Val.toLowerCase() : this.Val; if(val <= filterVal)
switch (this.Operator) {
result = true;
}
break;
}
case c_oAscCustomAutoFilter.beginsWith://beginsWith
{ {
case c_oAscCustomAutoFilter.beginsWith:
if(!isDigitValue) if(!isDigitValue)
{ {
if(val.startsWith(filterVal))//beginsWith if(val.startsWith(filterVal))
result = true; result = true;
} }
break; break;
case c_oAscCustomAutoFilter.doesNotBeginWith: }
case c_oAscCustomAutoFilter.doesNotBeginWith://doesNotBeginWith
{
if(!isDigitValue) if(!isDigitValue)
{ {
if(!val.startsWith(filterVal))//doesNotBeginWith if(!val.startsWith(filterVal))
result = true; result = true;
} }
else else
result = true; result = true;
break; break;
case c_oAscCustomAutoFilter.endsWith: }
case c_oAscCustomAutoFilter.endsWith://endsWith
{
if(!isDigitValue) if(!isDigitValue)
{ {
if(val.endsWith(filterVal))//endsWith if(val.endsWith(filterVal))
result = true; result = true;
} }
break; break;
case c_oAscCustomAutoFilter.doesNotEndWith: }
case c_oAscCustomAutoFilter.doesNotEndWith://doesNotEndWith
{
if(!isDigitValue) if(!isDigitValue)
{ {
if(!val.endsWith(filterVal))//doesNotEndWith if(!val.endsWith(filterVal))
result = true; result = true;
} }
else else
result = true; result = true;
break; break;
case c_oAscCustomAutoFilter.contains: }
case c_oAscCustomAutoFilter.contains://contains
{
if(!isDigitValue) if(!isDigitValue)
{ {
if(val.indexOf(filterVal) != -1)//contains if(val.indexOf(filterVal) !== -1)
result = true; result = true;
} }
break; break;
case c_oAscCustomAutoFilter.doesNotContain: }
case c_oAscCustomAutoFilter.doesNotContain://doesNotContain
{
if(!isDigitValue) if(!isDigitValue)
{ {
if(val.indexOf(filterVal) == -1)//doesNotContain if(val.indexOf(filterVal) === -1)
result = true; result = true;
} }
else else
result = true; result = true;
break
break;
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment