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
7bea6f90
Commit
7bea6f90
authored
Apr 07, 2016
by
GoshaZotov
Committed by
Alexander.Trofimov
May 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add function changeTableRef(defNames)
parent
fa9b68e7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
17 deletions
+62
-17
cell/model/Workbook.js
cell/model/Workbook.js
+28
-0
cell/model/autofilters.js
cell/model/autofilters.js
+1
-4
cell/view/WorkbookView.js
cell/view/WorkbookView.js
+6
-4
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+27
-9
No files found.
cell/model/Workbook.js
View file @
7bea6f90
...
...
@@ -1152,6 +1152,34 @@ DependencyGraph.prototype = {
table
.
Ref
=
table
.
Ref
.
split
(
"
!
"
)[
0
]
+
"
!
"
+
newRefClone
.
getAbsName
();
table
.
rebuild
();
// table.Ref = parserHelp.getEscapeSheetName(ws.getName())+"!"+newRef.getAbsName();
},
changeTableRef
:
function
(
tableName
,
ws
,
newName
){
var
table
=
this
.
getDefNameNodeByName
(
tableName
,
ws
);
var
newTable
=
table
.
clone
();
if
(
table
)
{
//изменяем имя именнованного диапазона
newTable
.
Name
=
newName
;
newTable
.
cellId
=
newName
.
toLowerCase
();
newTable
.
nodeId
=
table
.
sheetId
+
table
.
cellId
;
this
.
changeDefName
(
table
,
newTable
);
//изменяем все ссылки на данную таблицу
var
nameRef
=
tableName
+
"
[]
"
;
for
(
var
i
in
this
.
defNameList
)
{
if
(
this
.
defNameList
[
i
]
&&
this
.
defNameList
[
i
].
Ref
&&
this
.
defNameList
[
i
].
Ref
===
nameRef
)
{
this
.
defNameList
[
i
].
Ref
=
newName
+
"
[]
"
;
}
}
}
table
.
rebuild
();
},
delTableName
:
function
(
name
,
ws
){
var
table
=
this
.
getDefNameNodeByName
(
name
,
ws
);
...
...
cell/model/autofilters.js
View file @
7bea6f90
...
...
@@ -2269,10 +2269,7 @@
History
.
StartTransaction
();
//TODO добавлять в историю смену именного диапазона
var
oldNamedrange
=
worksheet
.
workbook
.
dependencyFormulas
.
getDefNameNodeByName
(
tablePart
.
DisplayName
);
var
newNamedrange
=
oldNamedrange
.
clone
();
newNamedrange
.
Name
=
newName
;
oldNamedrange
.
changeDefName
(
newNamedrange
);
worksheet
.
workbook
.
dependencyFormulas
.
changeTableRef
(
tableName
,
worksheet
,
newName
);
tablePart
.
changeDisplayName
(
newName
);
...
...
cell/view/WorkbookView.js
View file @
7bea6f90
...
...
@@ -2813,10 +2813,12 @@
color
=
null
;
if
(
styleOptions
.
totalRow
&&
styleOptions
.
totalRow
.
dxf
.
fill
&&
null
!=
styleOptions
.
totalRow
.
dxf
.
fill
.
bg
)
color
=
styleOptions
.
totalRow
.
dxf
.
fill
.
bg
;
else
color
=
defaultColorBackground
;
ctx
.
setFillStyle
(
color
);
ctx
.
fillRect
(
0
,
stepY
*
4
,
xSize
,
stepY
);
if
(
color
!==
null
)
{
ctx
.
setFillStyle
(
color
);
ctx
.
fillRect
(
0
,
stepY
*
4
,
xSize
,
stepY
);
}
}
...
...
cell/view/WorksheetView.js
View file @
7bea6f90
...
...
@@ -12813,8 +12813,12 @@
var
isChangeTableInfo
=
this
.
af_checkChangeTableInfo
(
tablePart
,
optionType
);
if
(
isChangeTableInfo
!==
false
)
{
var
callback
=
function
()
var
callback
=
function
(
isSuccess
)
{
if
(
false
===
isSuccess
)
{
return
;
}
History
.
Create_NewPoint
();
History
.
StartTransaction
();
t
.
model
.
autoFilters
.
changeFormatTableInfo
(
tableName
,
optionType
,
val
);
...
...
@@ -12971,7 +12975,11 @@
return
;
}
var
callback
=
function
()
{
var
callback
=
function
(
isSuccess
)
{
if
(
false
===
isSuccess
)
{
return
;
}
History
.
Create_NewPoint
();
History
.
StartTransaction
();
...
...
@@ -13171,15 +13179,25 @@
WorksheetView
.
prototype
.
af_changeTableRange
=
function
(
tableName
,
range
)
{
History
.
Create_NewPoint
();
History
.
StartTransaction
();
var
t
=
this
;
range
=
Asc
.
g_oRangeCache
.
getAscRange
(
range
);
this
.
model
.
autoFilters
.
changeTableRange
(
tableName
,
range
);
this
.
_onUpdateFormatTable
(
range
,
false
,
true
);
//TODO добавить перерисовку таблицы и перерисовку шаблонов
History
.
EndTransaction
();
var
callback
=
function
(
isSuccess
)
{
if
(
false
===
isSuccess
)
{
return
;
}
History
.
Create_NewPoint
();
History
.
StartTransaction
();
t
.
model
.
autoFilters
.
changeTableRange
(
tableName
,
range
);
t
.
_onUpdateFormatTable
(
range
,
false
,
true
);
//TODO добавить перерисовку таблицы и перерисовку шаблонов
History
.
EndTransaction
();
};
t
.
_isLockedCells
(
range
,
null
,
callback
);
};
WorksheetView
.
prototype
.
af_checkChangeRange
=
function
(
range
)
...
...
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