Commit 7834eb98 authored by GoshaZotov's avatar GoshaZotov Committed by Alexander.Trofimov

add functions asc_setSortColor and asc_getSortColor

parent 418d775c
......@@ -137,6 +137,7 @@
this.isTextFilter = null;
this.colorsFill = null;
this.colorsFont = null;
this.sortColor = null;
return this;
}
......@@ -159,6 +160,7 @@
case this.Properties.isTextFilter: return this.isTextFilter; break;
case this.Properties.colorsFill: return this.colorsFill; break;
case this.Properties.colorsFont: return this.colorsFont; break;
case this.Properties.sortColor: return this.sortColor; break;
}
return null;
......@@ -173,6 +175,7 @@
case this.Properties.isTextFilter: this.IsTextFilter = value;break;
case this.Properties.colorsFill: this.colorsFill = value;break;
case this.Properties.colorsFont: this.colorsFont = value;break;
case this.Properties.sortColor: this.sortColor = value;break;
}
},
......@@ -187,16 +190,18 @@
asc_setIsTextFilter : function(val) { this.isTextFilter = val; },
asc_setColorsFill : function(val) { this.colorsFill = val; },
asc_setColorsFont : function(val) { this.colorsFont = val; },
asc_setSortColor : function(val) { this.sortColor = val; },
asc_getCellId : function() { return this.cellId; },
asc_getValues : function() { return this.values; },
asc_getFilterObj : function() { return this.filter; },
asc_getSortState : function() { return this.sortVal; },
asc_getDisplayName : function(val) { return this.displayName; },
asc_getIsTextFilter : function(val) { return this.isTextFilter; },
asc_getColorsFill : function(val) { return this.colorsFill; },
asc_getColorsFont : function(val) { return this.colorsFont; }
asc_getDisplayName : function() { return this.displayName; },
asc_getIsTextFilter : function() { return this.isTextFilter; },
asc_getColorsFill : function() { return this.colorsFill; },
asc_getColorsFont : function() { return this.colorsFont; },
asc_getSortColor : function() { return this.sortColor; }
};
var g_oAutoFilterObj = {
......@@ -4710,6 +4715,7 @@
prot["asc_getIsTextFilter"] = prot.asc_getIsTextFilter;
prot["asc_getColorsFill"] = prot.asc_getColorsFill;
prot["asc_getColorsFont"] = prot.asc_getColorsFont;
prot["asc_getSortColor"] = prot.asc_getSortColor;
window["AscCommonExcel"].AutoFilterObj = AutoFilterObj;
prot = AutoFilterObj.prototype;
......
......@@ -12674,22 +12674,27 @@
filterObj.type = c_oAscAutoFilterTypes.Filters;
//get sort
var sortVal = false;
var sortVal = null;
var sortColor = null;
if(filter && filter.SortState && filter.SortState.SortConditions && filter.SortState.SortConditions[0])
{
if(rangeButton.r1 == filter.SortState.SortConditions[0].Ref.r1 && rangeButton.c1 == filter.SortState.SortConditions[0].Ref.c1)
var SortConditions = filter.SortState.SortConditions[0];
if(rangeButton.r1 == SortConditions.Ref.r1 && rangeButton.c1 == SortConditions.Ref.c1)
{
var conditionSortBy = filter.SortState.SortConditions[0].ConditionSortBy;
var conditionSortBy = SortConditions.ConditionSortBy;
switch(conditionSortBy)
{
case Asc.ESortBy.sortbyCellColor:
{
sortVal = Asc.c_oAscSortOptions.ByColorFill;
sortColor = SortConditions.dxf && SortConditions.dxf.fill ? SortConditions.dxf.fill.bg : null;
break;
}
case Asc.ESortBy.sortbyFontColor:
{
sortVal = Asc.c_oAscSortOptions.ByColorFont;
sortColor = SortConditions.dxf && SortConditions.dxf.font ? SortConditions.dxf.font.c : null;
break;
}
default:
......@@ -12705,6 +12710,17 @@
}
}
var ascColor = null;
if(null !== sortColor)
{
ascColor = new Asc.asc_CColor();
ascColor.asc_putR(sortColor.getR());
ascColor.asc_putG(sortColor.getG());
ascColor.asc_putB(sortColor.getB());
ascColor.asc_putA(sortColor.getA());
}
//set menu object
var autoFilterObject = new AscCommonExcel.AutoFiltersOptions();
......@@ -12714,6 +12730,7 @@
autoFilterObject.asc_setFilterObj(filterObj);
autoFilterObject.asc_setAutomaticRowCount(automaticRowCount);
autoFilterObject.asc_setDiplayName(displayName);
autoFilterObject.asc_setSortColor(ascColor);
var columnRange = Asc.Range(rangeButton.c1, autoFilter.Ref.r1 + 1, rangeButton.c1, autoFilter.Ref.r2);
......
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