Commit 5e721720 authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

добавил handlers в worksheet, event asc_onChangeRefTablePart

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@63855 954022d7-b5bf-4e40-9824-e11837661b57
parent ed6d2a3c
......@@ -3635,7 +3635,7 @@
var oThis = this;
if ( c_oSer_TablePart.Table == type )
{
var oNewTable = new TablePart();
var oNewTable = this.ws.createTablePart();
res = this.bcr.Read1(length, function(t,l){
return oThis.ReadTable(t,l, oNewTable);
});
......
......@@ -2856,6 +2856,9 @@ function Woorksheet(wb, _index, sId){
this.oDrawingOjectsManager = new DrawingObjectsManager(this);
this.contentChanges = new CContentChanges();
/*handlers*/
this.handlers = null;
}
Woorksheet.prototype.addContentChanges = function(changes)
......@@ -3108,6 +3111,11 @@ Woorksheet.prototype.initPostOpen = function(){
// Даже если не было, создадим
this.sheetViews.push(new asc.asc_CSheetViewSettings());
}
this.handlers = new asc.asc_CHandlersList(/*handlers*/{
"changeRefTablePart" : function (displayName, ref) {self.handlers.trigger("asc_onChangeRefTablePart", displayName, ref);}
});
};
Woorksheet.prototype._forEachCell=function(fAction){
for(var rowInd in this.aGCells){
......@@ -4834,6 +4842,10 @@ Woorksheet.prototype.expandRangeByMerged = function(range){
}
return range;
};
Woorksheet.prototype.createTablePart = function(){
return new TablePart(this.handlers);
};
//-------------------------------------------------------------------------------------------------
/**
* @constructor
......
......@@ -4304,7 +4304,7 @@ CellArea.prototype = {
// For Auto Filters
/** @constructor */
function TablePart() {
function TablePart(handlers) {
this.Ref = null;
this.HeaderRowCount = null;
this.TotalsRowCount = null;
......@@ -4315,9 +4315,10 @@ function TablePart() {
this.TableStyleInfo = null;
this.result = null;
this.handlers = handlers;
}
TablePart.prototype.clone = function(ws) {
var i, res = new TablePart();
var i, res = new TablePart(this.handlers);
res.Ref = this.Ref ? this.Ref.clone() : null;
res.HeaderRowCount = this.HeaderRowCount;
res.TotalsRowCount = this.TotalsRowCount;
......@@ -4354,7 +4355,8 @@ TablePart.prototype.moveRef = function(col, row, ws) {
var worksheet = ws.model;
this.Ref = ref;
worksheet.workbook.dependencyFormulas.changeTableName( this.DisplayName, worksheet, this.Ref );
//event
this.handlers.trigger("changeRefTablePart", this.DisplayName, this.Ref);
if(this.AutoFilter)
this.AutoFilter.moveRef(col, row);
......
......@@ -3137,7 +3137,7 @@ var maxIndividualValues = 10000;
aWs.TableParts = [];
//ref = Asc.g_oRangeCache.getAscRange(val[0].id + ':' + val[val.length - 1].idNext).clone();
newFilter = new TablePart();
newFilter = aWs.createTablePart();
newFilter.Ref = ref;
if(!bWithoutFilter)
......
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