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

changed function CustomFilter.prototype.isHideValue

parent a2687c6e
...@@ -5665,109 +5665,167 @@ CustomFilter.prototype.isHideValue = function(val) { ...@@ -5665,109 +5665,167 @@ 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;
}
else if(isNumberFilter)
{
if(isNaN(this.Val))
{
return !result;
}
else
{
filterVal = parseFloat(this.Val);
val = parseFloat(val);
}
}
else
{ {
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 }
switch (this.Operator)
{
case c_oAscCustomAutoFilter.equals://equals
{ {
if(val == filterVal) if(val === filterVal)
{
result = true; result = true;
}
break;
} }
else if (this.Operator == c_oAscCustomAutoFilter.doesNotEqual)//doesNotEqual case c_oAscCustomAutoFilter.doesNotEqual://doesNotEqual
{ {
if(val != filterVal) if(val !== filterVal)
{
result = true; result = true;
}
break;
} }
}
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))//только для чисел
{
filterVal = parseFloat(this.Val);
val = parseFloat(val);
switch (this.Operator) case c_oAscCustomAutoFilter.isGreaterThan://isGreaterThan
{ {
case c_oAscCustomAutoFilter.isGreaterThan: if(val > filterVal)
if(val > filterVal)//isGreaterThan {
result = true; result = true;
break; }
case c_oAscCustomAutoFilter.isGreaterThanOrEqualTo:
if(val >= filterVal)//isGreaterThanOrEqualTo break;
}
case c_oAscCustomAutoFilter.isGreaterThanOrEqualTo://isGreaterThanOrEqualTo
{
if(val >= filterVal)
{
result = true;
}
break;
}
case c_oAscCustomAutoFilter.isLessThan://isLessThan
{
if(val < filterVal)
{
result = true;
}
break;
}
case c_oAscCustomAutoFilter.isLessThanOrEqualTo://isLessThanOrEqualTo
{
if(val <= filterVal)
{
result = true;
}
break;
}
case c_oAscCustomAutoFilter.beginsWith://beginsWith
{
if(!isDigitValue)
{
if(val.startsWith(filterVal))
result = true; result = true;
break; }
case c_oAscCustomAutoFilter.isLessThan:
if(val < filterVal)//isLessThan break;
}
case c_oAscCustomAutoFilter.doesNotBeginWith://doesNotBeginWith
{
if(!isDigitValue)
{
if(!val.startsWith(filterVal))
result = true; result = true;
break; }
case c_oAscCustomAutoFilter.isLessThanOrEqualTo: else
if(val <= filterVal)//isLessThanOrEqualTo result = true;
break;
}
case c_oAscCustomAutoFilter.endsWith://endsWith
{
if(!isDigitValue)
{
if(val.endsWith(filterVal))
result = true; result = true;
break; }
break;
} }
} case c_oAscCustomAutoFilter.doesNotEndWith://doesNotEndWith
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)//только для текста
{
filterVal = isNaN(this.Val) ? this.Val.toLowerCase() : this.Val;
switch (this.Operator)
{ {
case c_oAscCustomAutoFilter.beginsWith: if(!isDigitValue)
if(!isDigitValue) {
{ if(!val.endsWith(filterVal))
if(val.startsWith(filterVal))//beginsWith
result = true;
}
break;
case c_oAscCustomAutoFilter.doesNotBeginWith:
if(!isDigitValue)
{
if(!val.startsWith(filterVal))//doesNotBeginWith
result = true;
}
else
result = true; result = true;
break; }
case c_oAscCustomAutoFilter.endsWith: else
if(!isDigitValue) result = true;
{
if(val.endsWith(filterVal))//endsWith break;
result = true; }
} case c_oAscCustomAutoFilter.contains://contains
break; {
case c_oAscCustomAutoFilter.doesNotEndWith: if(!isDigitValue)
if(!isDigitValue) {
{ if(val.indexOf(filterVal) !== -1)
if(!val.endsWith(filterVal))//doesNotEndWith
result = true;
}
else
result = true; result = true;
break; }
case c_oAscCustomAutoFilter.contains:
if(!isDigitValue) break;
{ }
if(val.indexOf(filterVal) != -1)//contains case c_oAscCustomAutoFilter.doesNotContain://doesNotContain
result = true; {
} if(!isDigitValue)
break; {
case c_oAscCustomAutoFilter.doesNotContain: if(val.indexOf(filterVal) === -1)
if(!isDigitValue)
{
if(val.indexOf(filterVal) == -1)//doesNotContain
result = true;
}
else
result = true; result = true;
break }
else
result = true;
break;
} }
} }
} }
return !result; return !result;
}; };
......
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