Commit 9600fc48 authored by GoshaZotov's avatar GoshaZotov

changes for search into database

parent 2982367b
...@@ -56,7 +56,14 @@ ...@@ -56,7 +56,14 @@
if("" === condition){ if("" === condition){
res = true; res = true;
}else{ }else{
res = AscCommonExcel.matching(val, AscCommonExcel.matchingValue(condition)); var conditionObj = AscCommonExcel.matchingValue(condition);
//если строка, без операторов, добавляем * для поиска совпадений начинающихся с данной строки
//так делает MS. lo ищет строгие совпадения
if(null === conditionObj.op && cElementType.string === conditionObj.val.type){
conditionObj.val.value += "*";
}
res = AscCommonExcel.matching(val, conditionObj);
} }
return res; return res;
} }
...@@ -159,14 +166,19 @@ ...@@ -159,14 +166,19 @@
var needDataColumn = headersDataMap[field]; var needDataColumn = headersDataMap[field];
var resArr = []; var resArr = [];
for(var i = 0; i < winElems.length; i++){ var usuallyAddElems = [];
for(var j in winElems[i]){ if(needDataColumn){
if(cElementType.empty === needDataColumn[j].type){ for(var i = 0; i < winElems.length; i++){
continue; for(var j in winElems[i]){
if(true === usuallyAddElems[j] || cElementType.empty === needDataColumn[j].type){
continue;
}
resArr.push(needDataColumn[j].getValue());
usuallyAddElems[j] = true;
} }
resArr.push(needDataColumn[j].getValue());
} }
} }
return resArr.length ? resArr : false; return resArr.length ? resArr : false;
} }
......
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