Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
6fcb5e62
Commit
6fcb5e62
authored
Apr 05, 2016
by
GoshaZotov
Committed by
Alexander.Trofimov
May 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes for update format table
parent
cd93bfe2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
12 deletions
+64
-12
cell/model/History.js
cell/model/History.js
+3
-0
cell/model/WorkbookElems.js
cell/model/WorkbookElems.js
+18
-0
cell/model/autofilters.js
cell/model/autofilters.js
+32
-8
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+11
-4
No files found.
cell/model/History.js
View file @
6fcb5e62
...
...
@@ -443,6 +443,9 @@ CHistory.prototype._addRedoObjectParam = function (oRedoObjectParam, Point) {
oRedoObjectParam
.
oOnUpdateSheetViewSettings
[
Point
.
SheetId
]
=
Point
.
SheetId
;
else
if
(
AscCommonExcel
.
g_oUndoRedoWorksheet
===
Point
.
Class
&&
(
historyitem_Worksheet_RemoveRows
===
Point
.
Type
||
historyitem_Worksheet_RemoveCols
===
Point
.
Type
||
historyitem_Worksheet_AddRows
===
Point
.
Type
||
historyitem_Worksheet_AddCols
===
Point
.
Type
))
oRedoObjectParam
.
bAddRemoveRowCol
=
true
;
else
if
(
g_oUndoRedoAutoFilters
===
Point
.
Class
&&
historyitem_AutoFilter_ChangeTableInfo
===
Point
.
Type
)
oRedoObjectParam
.
oChangeWorksheetUpdate
[
Point
.
SheetId
]
=
Point
.
SheetId
;
};
CHistory
.
prototype
.
Get_RecalcData
=
function
(
Point2
)
{
...
...
cell/model/WorkbookElems.js
View file @
6fcb5e62
...
...
@@ -4782,6 +4782,16 @@ TablePart.prototype.isShowButton = function()
return
res
;
};
TablePart
.
prototype
.
generateTotalsRowLabel
=
function
()
{
if
(
!
this
.
TableColumns
)
{
return
;
}
this
.
TableColumns
[
0
].
generateTotalsRowLabel
();
};
/** @constructor */
function
AutoFilter
()
{
this
.
Ref
=
null
;
...
...
@@ -4983,6 +4993,14 @@ TableColumn.prototype.clone = function() {
res
.
CalculatedColumnFormula
=
this
.
CalculatedColumnFormula
;
return
res
;
};
TableColumn
.
prototype
.
generateTotalsRowLabel
=
function
(){
//TODO добавить в перевод
if
(
this
.
TotalsRowLabel
===
null
)
{
this
.
TotalsRowLabel
=
"
Summary
"
;
}
};
/** @constructor */
function
TableStyleInfo
()
{
this
.
Name
=
null
;
...
...
cell/model/autofilters.js
View file @
6fcb5e62
...
...
@@ -2151,6 +2151,11 @@
tablePart
.
TotalsRowCount
=
tablePart
.
TotalsRowCount
===
null
?
1
:
null
;
}
if
(
val
===
true
)
{
tablePart
.
generateTotalsRowLabel
();
}
}
break
;
...
...
@@ -3764,20 +3769,39 @@
if
(
style
&&
style
.
Name
&&
worksheet
.
workbook
.
TableStyles
&&
worksheet
.
workbook
.
TableStyles
.
AllStyles
&&
(
styleForCurTable
=
worksheet
.
workbook
.
TableStyles
.
AllStyles
[
style
.
Name
]))
{
//заполняем названия столбцов
if
(
true
!=
isOpenFilter
&&
headerRowCount
>
0
&&
options
.
TableColumn
s
)
if
(
true
!=
isOpenFilter
&&
isSetVal
&&
!
bRedoChange
s
)
{
for
(
var
ncol
=
bbox
.
c1
;
ncol
<=
bbox
.
c2
;
ncol
++
)
if
((
headerRowCount
>
0
||
totalsRowCount
>
0
)
&&
options
.
TableColumns
)
{
var
range
=
worksheet
.
getCell3
(
bbox
.
r1
,
ncol
);
var
num
=
ncol
-
bbox
.
c1
;
var
tableColumn
=
options
.
TableColumns
[
num
];
if
(
null
!=
tableColumn
&&
null
!=
tableColumn
.
Name
&&
!
bRedoChanges
&&
isSetVal
)
for
(
var
ncol
=
bbox
.
c1
;
ncol
<=
bbox
.
c2
;
ncol
++
)
{
range
.
setValue
(
tableColumn
.
Name
);
range
.
setType
(
CellValueType
.
String
);
var
range
=
worksheet
.
getCell3
(
bbox
.
r1
,
ncol
);
var
num
=
ncol
-
bbox
.
c1
;
var
tableColumn
=
options
.
TableColumns
[
num
];
if
(
null
!=
tableColumn
&&
null
!=
tableColumn
.
Name
&&
headerRowCount
>
0
)
{
range
.
setValue
(
tableColumn
.
Name
);
range
.
setType
(
CellValueType
.
String
);
}
if
(
tableColumn
!==
null
&&
tableColumn
.
TotalsRowLabel
!==
null
&&
totalsRowCount
>
0
)
{
range
=
worksheet
.
getCell3
(
bbox
.
r2
,
ncol
);
range
.
setValue
(
tableColumn
.
TotalsRowLabel
);
range
.
setType
(
CellValueType
.
String
);
//TODO + далее необходимо добавлять формулу
}
}
}
else
if
(
totalsRowCount
)
{
//var range = worksheet.getCell3(bbox.r2, bbox.c1);
//range.setValue(tableColumn.Name);
//range.setType(CellValueType.String);
}
}
//заполняем стили
var
aNoHiddenCol
=
[];
for
(
var
i
=
bbox
.
c1
;
i
<=
bbox
.
c2
;
i
++
)
...
...
cell/view/WorksheetView.js
View file @
6fcb5e62
...
...
@@ -10206,7 +10206,7 @@
return
true
;
};
WorksheetView
.
prototype
.
changeWorksheet
=
function
(
prop
,
val
,
displayNameFormatTable
)
{
WorksheetView
.
prototype
.
changeWorksheet
=
function
(
prop
,
val
)
{
// Проверка глобального лока
if
(
this
.
collaborativeEditing
.
getGlobalLock
()
)
{
return
;
...
...
@@ -10340,7 +10340,7 @@
functionModelAction
=
function
()
{
History
.
Create_NewPoint
();
History
.
StartTransaction
();
if
(
range
.
addCellsShiftRight
(
displayNameFormatTable
)
)
{
if
(
range
.
addCellsShiftRight
()
)
{
fullRecalc
=
true
;
reinitRanges
=
true
;
t
.
cellCommentator
.
updateCommentsDependencies
(
true
,
val
,
arn
);
...
...
@@ -10361,7 +10361,7 @@
functionModelAction
=
function
()
{
History
.
Create_NewPoint
();
History
.
StartTransaction
();
if
(
range
.
addCellsShiftBottom
(
displayNameFormatTable
)
)
{
if
(
range
.
addCellsShiftBottom
()
)
{
fullRecalc
=
true
;
reinitRanges
=
true
;
t
.
cellCommentator
.
updateCommentsDependencies
(
true
,
val
,
arn
);
...
...
@@ -12812,10 +12812,13 @@
var
isChangeTableInfo
=
this
.
af_checkChangeTableInfo
(
tablePart
,
optionType
);
if
(
isChangeTableInfo
!==
false
)
{
History
.
Create_NewPoint
();
History
.
StartTransaction
();
this
.
model
.
autoFilters
.
changeFormatTableInfo
(
tableName
,
optionType
,
val
);
this
.
_onUpdateFormatTable
(
isChangeTableInfo
,
false
,
true
);
//TODO добавить перерисовку таблицы и перерисовку шаблонов
History
.
EndTransaction
();
}
};
...
...
@@ -13037,7 +13040,11 @@
}
//TODO тестовый вариант. нужно сделать методы и добавлять в историю
//ws.workbook.dependencyFormulas.changeDefName( tableName, newName );
var
oldNamedrange
=
this
.
model
.
workbook
.
dependencyFormulas
.
getDefNameNodeByName
(
tablePart
.
DisplayName
);
var
newNamedrange
=
oldNamedrange
.
clone
();
newNamedrange
.
Name
=
newName
;
oldNamedrange
.
changeDefName
(
newNamedrange
);
tablePart
.
DisplayName
=
newName
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment