Commit 651d518e authored by GoshaZotov's avatar GoshaZotov

change function af_changeFormatTableInfo

parent 1382eb44
...@@ -1922,15 +1922,8 @@ var maxIndividualValues = 10000; ...@@ -1922,15 +1922,8 @@ var maxIndividualValues = 10000;
return result; return result;
}, },
changeFormatTableInfo: function(tableName, optionType) changeFormatTableInfo: function(tablePart, optionType)
{ {
var tablePart = this._getFilterByDisplayName(tableName);
if(!tablePart || (tablePart && !tablePart.TableStyleInfo))
{
return false;
}
switch(optionType) switch(optionType)
{ {
case c_oAscChangeTableStyleInfo.columnBanded: case c_oAscChangeTableStyleInfo.columnBanded:
...@@ -1975,6 +1968,9 @@ var maxIndividualValues = 10000; ...@@ -1975,6 +1968,9 @@ var maxIndividualValues = 10000;
}*/ }*/
} }
this._cleanStyleTable(tablePart.Ref);
this._setColorStyleTable(tablePart.Ref, tablePart);
//TODO add to history //TODO add to history
}, },
......
...@@ -7301,7 +7301,7 @@ ...@@ -7301,7 +7301,7 @@
cell_info.formatTableInfo.bandHor = tableStyleInfo.ShowRowStripes; cell_info.formatTableInfo.bandHor = tableStyleInfo.ShowRowStripes;
} }
cell_info.formatTableInfo.lastRow = curTablePart.TotalsRowCount !== null ? true : false; cell_info.formatTableInfo.lastRow = curTablePart.TotalsRowCount !== null ? true : false;
cell_info.formatTableInfo.firstRow = curTablePart.HeaderRowCount !== null ? true : false; cell_info.formatTableInfo.firstRow = curTablePart.HeaderRowCount === null ? true : false;
//cell_info.formatTableInfo.filterButton = curTablePart.HeaderRowCount !== null ? true : false; //cell_info.formatTableInfo.filterButton = curTablePart.HeaderRowCount !== null ? true : false;
} }
...@@ -12773,8 +12773,36 @@ ...@@ -12773,8 +12773,36 @@
WorksheetView.prototype.af_changeFormatTableInfo = function(tableName, optionType) WorksheetView.prototype.af_changeFormatTableInfo = function(tableName, optionType)
{ {
this.model.autoFilters.changeFormatTableInfo(tableName, optionType); var tablePart = this.model.autoFilters._getFilterByDisplayName(tableName);
//TODO добавить перерисовку таблицы и перерисовку шаблонов
if(!tablePart || (tablePart && !tablePart.TableStyleInfo))
{
return false;
}
var isChangeTableInfo = this.af_checkChangeTableInfo(tablePart, optionType);
if(isChangeTableInfo !== false)
{
this.model.autoFilters.changeFormatTableInfo(tablePart, optionType);
this._onUpdateFormatTable(isChangeTableInfo, false, true);
//TODO добавить перерисовку таблицы и перерисовку шаблонов
}
};
WorksheetView.prototype.af_checkChangeTableInfo = function(tablePart, optionType)
{
var updateRange = tablePart.Ref;
if(optionType === c_oAscChangeTableStyleInfo.rowHeader && tablePart.HeaderRowCount !== null)//add header row
{
}
else if(optionType === c_oAscChangeTableStyleInfo.rowTotal && tablePart.TotalsRowCount !== null)//add total row
{
}
return updateRange;
}; };
/* /*
......
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