Commit 8c221e8e authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

использую String.startsWith и String.endsWith

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64320 954022d7-b5bf-4e40-9824-e11837661b57
parent 6ac2fccb
...@@ -5071,32 +5071,30 @@ CustomFilter.prototype.isHideValue = function(val) { ...@@ -5071,32 +5071,30 @@ CustomFilter.prototype.isHideValue = function(val) {
case c_oAscCustomAutoFilter.beginsWith: case c_oAscCustomAutoFilter.beginsWith:
if(!isDigitValue) if(!isDigitValue)
{ {
if(val.indexOf(filterVal) == 0)//beginsWith if(val.startsWith(filterVal))//beginsWith
result = true; result = true;
} }
break; break;
case c_oAscCustomAutoFilter.doesNotBeginWith: case c_oAscCustomAutoFilter.doesNotBeginWith:
if(!isDigitValue) if(!isDigitValue)
{ {
if(val.indexOf(filterVal) != 0)//doesNotBeginWith if(!val.startsWith(filterVal))//doesNotBeginWith
result = true; result = true;
} }
else else
result = true; result = true;
break; break;
case c_oAscCustomAutoFilter.endsWith: case c_oAscCustomAutoFilter.endsWith:
position = val.length - filterVal.length;
if(!isDigitValue) if(!isDigitValue)
{ {
if(val.lastIndexOf(filterVal) == position && position > 0)//endsWith if(val.endsWith(filterVal))//endsWith
result = true; result = true;
} }
break; break;
case c_oAscCustomAutoFilter.doesNotEndWith: case c_oAscCustomAutoFilter.doesNotEndWith:
position = val.length - filterVal.length;
if(!isDigitValue) if(!isDigitValue)
{ {
if(val.lastIndexOf(filterVal) != position && position > 0)//doesNotEndWith if(!val.endsWith(filterVal))//doesNotEndWith
result = true; result = true;
} }
else else
......
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