Commit 753d59b4 authored by GoshaZotov's avatar GoshaZotov Committed by Alexander.Trofimov

change in function applyAutoFilterByType

parent 31082d6c
...@@ -12014,7 +12014,7 @@ ...@@ -12014,7 +12014,7 @@
var ar = t.activeRange.clone( true ); var ar = t.activeRange.clone( true );
var isStartRangeIntoFilterOrTable = t.model.autoFilters.isStartRangeContainIntoTableOrFilter(ar); var isStartRangeIntoFilterOrTable = t.model.autoFilters.isStartRangeContainIntoTableOrFilter(ar);
var isApplyAutoFilter = null, iaAddAutoFilter = null, cellId = null; var isApplyAutoFilter = null, isAddAutoFilter = null, cellId = null;
if(null !== isStartRangeIntoFilterOrTable)//into autofilter or format table if(null !== isStartRangeIntoFilterOrTable)//into autofilter or format table
{ {
var isFromatTable = !(-1 === isStartRangeIntoFilterOrTable); var isFromatTable = !(-1 === isStartRangeIntoFilterOrTable);
...@@ -12024,12 +12024,12 @@ ...@@ -12024,12 +12024,12 @@
if(isFromatTable && !t.model.TableParts[isStartRangeIntoFilterOrTable].AutoFilter)//add autofilter to tablepart if(isFromatTable && !t.model.TableParts[isStartRangeIntoFilterOrTable].AutoFilter)//add autofilter to tablepart
{ {
iaAddAutoFilter = true; isAddAutoFilter = true;
} }
} }
else//without filter else//without filter
{ {
iaAddAutoFilter = true; isAddAutoFilter = true;
} }
...@@ -12043,7 +12043,7 @@ ...@@ -12043,7 +12043,7 @@
if(null !== isAddAutoFilter) if(null !== isAddAutoFilter)
{ {
t.model.autoFilters.addAutoFilter(null, ar, addFormatTableOptionsObj); t.model.autoFilters.addAutoFilter(null, ar, null);
if(null === cellId) if(null === cellId)
{ {
cellId = t.model.autoFilters._rangeToId(Asc.Range(ar.startCol, t.model.AutoFilter.Ref.r1, ar.startCol, t.model.AutoFilter.Ref.r1)); cellId = t.model.autoFilters._rangeToId(Asc.Range(ar.startCol, t.model.AutoFilter.Ref.r1, ar.startCol, t.model.AutoFilter.Ref.r1));
...@@ -12053,21 +12053,13 @@ ...@@ -12053,21 +12053,13 @@
if(null !== isApplyAutoFilter) if(null !== isApplyAutoFilter)
{ {
autoFilterObject.asc_setCellId(cellId); autoFilterObject.asc_setCellId(cellId);
if(c_oAscAutoFilterTypes.Filters === autoFilterObject.filter.type) if(c_oAscAutoFilterTypes.CustomFilters === autoFilterObject.filter.type)
{ {
var autoFiltersOptionsElement = new AutoFiltersOptionsElements();
var cell = t.model._getCell( ar.startRow, ar.startCol); var cell = t.model._getCell( ar.startRow, ar.startCol);
var text = cell.getValueWithFormat();
var val = cell.getValueWithoutFormat(); var val = cell.getValueWithoutFormat();
autoFilterObject.filter.filter.CustomFilters[0].Val = val;
autoFiltersOptionsElement.visible = true;
autoFiltersOptionsElement.val = val;
autoFiltersOptionsElement.text = text;
autoFiltersOptionsElement.isDateFormat = cell.getNumFormat().isDateTimeFormat();
autoFilterObject.values.push(autoFiltersOptionsElement);
} }
var applyFilterProps = t.model.autoFilters.applyAutoFilter( autoFilterObject, ar ); var applyFilterProps = t.model.autoFilters.applyAutoFilter( autoFilterObject, ar );
var rowChange = applyFilterProps.rowChange; var rowChange = applyFilterProps.rowChange;
var rangeOldFilter = applyFilterProps.rangeOldFilter; var rangeOldFilter = applyFilterProps.rangeOldFilter;
...@@ -12085,13 +12077,13 @@ ...@@ -12085,13 +12077,13 @@
History.EndTransaction(); History.EndTransaction();
}; };
if(null !== isAddAutoFilter)//do not add autoFilter if(null === isAddAutoFilter)//do not add autoFilter
{ {
this._isLockedAll( onChangeAutoFilterCallback ); this._isLockedAll( onChangeAutoFilterCallback );
} }
else//add autofilter + apply else//add autofilter + apply
{ {
if ( t._checkAddAutoFilter( ar, styleName, addFormatTableOptionsObj ) === true ) { if ( t._checkAddAutoFilter( ar, null, autoFilterObject ) === true ) {
this._isLockedAll( onChangeAutoFilterCallback ); this._isLockedAll( onChangeAutoFilterCallback );
this._isLockedDefNames( null, null ); this._isLockedDefNames( null, null );
} }
......
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