[SSE] Show previouse settings for between autofilter (don't change "and/or" option).

This commit is contained in:
Julia Radzhabova 2018-03-21 15:28:09 +03:00
parent e86454d8d6
commit 0e68fbe525

View file

@ -850,14 +850,16 @@ define([
newCustomFilter.asc_setCustomFilters((item.value == -2) ? [new Asc.CustomFilter(), new Asc.CustomFilter()]: [new Asc.CustomFilter()]);
var newCustomFilters = newCustomFilter.asc_getCustomFilters();
newCustomFilter.asc_setAnd(true);
newCustomFilters[0].asc_setOperator((item.value == -2) ? Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo : item.value);
if (item.value == -2) {
newCustomFilters[0].asc_setVal((cond1 == Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo && cond2 == Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo) ? value1 : '');
var isBetween = (cond1 == Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo && cond2 == Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo);
newCustomFilter.asc_setAnd(isBetween ? isAnd : true);
newCustomFilters[0].asc_setVal(isBetween ? value1 : '');
newCustomFilters[1].asc_setOperator(Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo);
newCustomFilters[1].asc_setVal((cond1 == Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo && cond2 == Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo) ? value2 : '');
newCustomFilters[1].asc_setVal(isBetween ? value2 : '');
} else {
newCustomFilter.asc_setAnd(true);
newCustomFilters[0].asc_setVal((item.value == cond1) ? value1 : '');
}