Commit bf3a0e89 authored by GoshaZotov's avatar GoshaZotov Committed by Alexander.Trofimov

add function changeTableStyleInfo(for change TableStyleInfo props)

parent a63b6487
...@@ -183,6 +183,13 @@ var c_oAscChangeSelectionFormatTable = { ...@@ -183,6 +183,13 @@ var c_oAscChangeSelectionFormatTable = {
column: 4 column: 4
}; };
var c_oAscChangeTableStyleInfo = {
showColumnStripes: 1,
showFirstColumn: 2,
showLastColumn: 3,
showRowStripes: 4
};
// Состояние редактора ячейки // Состояние редактора ячейки
var c_oAscCellEditorState = { var c_oAscCellEditorState = {
editEnd: 0, // Окончание редактирования editEnd: 0, // Окончание редактирования
......
...@@ -1904,6 +1904,42 @@ ...@@ -1904,6 +1904,42 @@
return result; 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 //TODO избавиться от split, передавать cellId и tableName
_getPressedFilter: function(activeRange, cellId) _getPressedFilter: function(activeRange, cellId)
{ {
......
...@@ -12705,14 +12705,14 @@ ...@@ -12705,14 +12705,14 @@
return true; return true;
}; };
WorksheetView.prototype.af_changeSelectionFormatTable = function(optionType, tableName) WorksheetView.prototype.af_changeSelectionFormatTable = function(tableName, optionType)
{ {
var t = this; var t = this;
var ws = this.model; 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; return false;
} }
...@@ -12727,7 +12727,7 @@ ...@@ -12727,7 +12727,7 @@
var newActiveRange; var newActiveRange;
switch(optionType) switch(optionType)
{ {
case c_oAscChangeSelectionFilter.all: case c_oAscChangeSelectionFormatTable.all:
{ {
startCol = refTablePart.c1; startCol = refTablePart.c1;
endCol = refTablePart.c2; endCol = refTablePart.c2;
...@@ -12736,7 +12736,7 @@ ...@@ -12736,7 +12736,7 @@
break; break;
} }
case c_oAscChangeSelectionFilter.data: case c_oAscChangeSelectionFormatTable.data:
{ {
//TODO проверить есть ли строка заголовков //TODO проверить есть ли строка заголовков
startCol = refTablePart.c1; startCol = refTablePart.c1;
...@@ -12746,7 +12746,7 @@ ...@@ -12746,7 +12746,7 @@
break; break;
} }
case c_oAscChangeSelectionFilter.row: case c_oAscChangeSelectionFormatTable.row:
{ {
startCol = refTablePart.c1; startCol = refTablePart.c1;
endCol = refTablePart.c2; endCol = refTablePart.c2;
...@@ -12755,7 +12755,7 @@ ...@@ -12755,7 +12755,7 @@
break; break;
} }
case c_oAscChangeSelectionFilter.column: case c_oAscChangeSelectionFormatTable.column:
{ {
startCol = this.activeRange.c1 < refTablePart.c1 ? refTablePart.c1 : this.activeRange.c1; startCol = this.activeRange.c1 < refTablePart.c1 ? refTablePart.c1 : this.activeRange.c1;
endCol = this.activeRange.c2 > refTablePart.r2 ? refTablePart.r2 : this.activeRange.r2; 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