|
@@ -649,6 +649,10 @@ const showSelectTab = function(select, spread, afterShow) {
|
|
searchList();
|
|
searchList();
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
+ const calulateSum = function () {
|
|
|
|
+ if (searchResult.length === 0 || !setting.calcSum) return;
|
|
|
|
+ searchResult.unshift(setting.calcSum(searchResult));
|
|
|
|
+ };
|
|
const searchList = function () {
|
|
const searchList = function () {
|
|
const keyword = $('#searchKeyword', obj).val();
|
|
const keyword = $('#searchKeyword', obj).val();
|
|
searchResult = [];
|
|
searchResult = [];
|
|
@@ -661,6 +665,7 @@ const showSelectTab = function(select, spread, afterShow) {
|
|
searchResult.push(data);
|
|
searchResult.push(data);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ calulateSum();
|
|
SpreadJsObj.loadSheetData(resultSpread.getActiveSheet(), 'data', searchResult);
|
|
SpreadJsObj.loadSheetData(resultSpread.getActiveSheet(), 'data', searchResult);
|
|
};
|
|
};
|
|
const getCheckFun = function (key) {
|
|
const getCheckFun = function (key) {
|
|
@@ -682,6 +687,7 @@ const showSelectTab = function(select, spread, afterShow) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ calulateSum();
|
|
SpreadJsObj.loadSheetData(resultSpread.getActiveSheet(), 'data', searchResult);
|
|
SpreadJsObj.loadSheetData(resultSpread.getActiveSheet(), 'data', searchResult);
|
|
};
|
|
};
|
|
|
|
|
|
@@ -691,7 +697,7 @@ const showSelectTab = function(select, spread, afterShow) {
|
|
$('button', obj).bind('click', () => {search()});
|
|
$('button', obj).bind('click', () => {search()});
|
|
resultSpread.getActiveSheet().bind(spreadNS.Events.CellDoubleClick, function (e, info) {
|
|
resultSpread.getActiveSheet().bind(spreadNS.Events.CellDoubleClick, function (e, info) {
|
|
const cur = SpreadJsObj.getSelectObject(info.sheet);
|
|
const cur = SpreadJsObj.getSelectObject(info.sheet);
|
|
- if (!cur) return;
|
|
|
|
|
|
+ if (!cur || cur.searchIndex < 0) return;
|
|
|
|
|
|
SpreadJsObj.locateRow(searchSheet, cur.searchIndex);
|
|
SpreadJsObj.locateRow(searchSheet, cur.searchIndex);
|
|
if (setting.afterLocated) {
|
|
if (setting.afterLocated) {
|