Commit ac2f1ecd authored by GoshaZotov's avatar GoshaZotov

add function changeTableStyleInfo(for change TableStyleInfo props)

parent 1e0e24da
......@@ -285,6 +285,13 @@ var c_oAscChangeSelectionFormatTable = {
column: 4
};
var c_oAscChangeTableStyleInfo = {
showColumnStripes: 1,
showFirstColumn: 2,
showLastColumn: 3,
showRowStripes: 4
};
// Состояние редактора ячейки
var c_oAscCellEditorState = {
editEnd: 0, // Окончание редактирования
......
......@@ -1922,6 +1922,42 @@ var maxIndividualValues = 10000;
return result;
},
changeTableStyleInfo: function(tableName, optionType)
{
var tablePart = this._getFilterByDisplayName(tableName);
if(!tablePart || (tablePart && !tablePart.TableStyleInfo))
{
return false;
}
switch(optionType)
{
case c_oAscChangeTableStyleInfo.showColumnStripes:
{
tablePart.TableStyleInfo.ShowColumnStripes = !tablePart.TableStyleInfo.ShowColumnStripes;
break;
}
case c_oAscChangeTableStyleInfo.showFirstColumn:
{
tablePart.TableStyleInfo.ShowFirstColumn = !tablePart.TableStyleInfo.ShowFirstColumn;
break;
}
case c_oAscChangeTableStyleInfo.showLastColumn:
{
tablePart.TableStyleInfo.ShowLastColumn = !tablePart.TableStyleInfo.ShowLastColumn;
break;
}
case c_oAscChangeTableStyleInfo.showRowStripes:
{
tablePart.TableStyleInfo.ShowRowStripes = !tablePart.TableStyleInfo.ShowRowStripes;
break;
}
}
//TODO add to history
};
//TODO избавиться от split, передавать cellId и tableName
_getPressedFilter: function(activeRange, cellId)
{
......
......@@ -12686,14 +12686,14 @@
return true;
};
WorksheetView.prototype.af_changeSelectionFormatTable = function(optionType, tableName)
WorksheetView.prototype.af_changeSelectionFormatTable = function(tableName, optionType)
{
var t = this;
var ws = this.model;
var tablePart = ws._getFilterByDisplayName(tableName);
var tablePart = ws.autoFilters._getFilterByDisplayName(tableName);
if(!tablePart || !(tablePart && tablePart.Ref))
if(!tablePart || (tablePart && !tablePart.Ref))
{
return false;
}
......@@ -12708,7 +12708,7 @@
var newActiveRange;
switch(optionType)
{
case c_oAscChangeSelectionFilter.all:
case c_oAscChangeSelectionFormatTable.all:
{
startCol = refTablePart.c1;
endCol = refTablePart.c2;
......@@ -12717,7 +12717,7 @@
break;
}
case c_oAscChangeSelectionFilter.data:
case c_oAscChangeSelectionFormatTable.data:
{
//TODO проверить есть ли строка заголовков
startCol = refTablePart.c1;
......@@ -12727,7 +12727,7 @@
break;
}
case c_oAscChangeSelectionFilter.row:
case c_oAscChangeSelectionFormatTable.row:
{
startCol = refTablePart.c1;
endCol = refTablePart.c2;
......@@ -12736,7 +12736,7 @@
break;
}
case c_oAscChangeSelectionFilter.column:
case c_oAscChangeSelectionFormatTable.column:
{
startCol = this.activeRange.c1 < refTablePart.c1 ? refTablePart.c1 : this.activeRange.c1;
endCol = this.activeRange.c2 > refTablePart.r2 ? refTablePart.r2 : this.activeRange.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