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
Show 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 = {
...
@@ -1152,6 +1152,34 @@ DependencyGraph.prototype = {
table
.
Ref
=
table
.
Ref
.
split
(
"
!
"
)[
0
]
+
"
!
"
+
newRefClone
.
getAbsName
();
table
.
Ref
=
table
.
Ref
.
split
(
"
!
"
)[
0
]
+
"
!
"
+
newRefClone
.
getAbsName
();
table
.
rebuild
();
table
.
rebuild
();
// table.Ref = parserHelp.getEscapeSheetName(ws.getName())+"!"+newRef.getAbsName();
// 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
){
delTableName
:
function
(
name
,
ws
){
var
table
=
this
.
getDefNameNodeByName
(
name
,
ws
);
var
table
=
this
.
getDefNameNodeByName
(
name
,
ws
);
...
...
cell/model/autofilters.js
View file @
7bea6f90
...
@@ -2269,10 +2269,7 @@
...
@@ -2269,10 +2269,7 @@
History
.
StartTransaction
();
History
.
StartTransaction
();
//TODO добавлять в историю смену именного диапазона
//TODO добавлять в историю смену именного диапазона
var
oldNamedrange
=
worksheet
.
workbook
.
dependencyFormulas
.
getDefNameNodeByName
(
tablePart
.
DisplayName
);
worksheet
.
workbook
.
dependencyFormulas
.
changeTableRef
(
tableName
,
worksheet
,
newName
);
var
newNamedrange
=
oldNamedrange
.
clone
();
newNamedrange
.
Name
=
newName
;
oldNamedrange
.
changeDefName
(
newNamedrange
);
tablePart
.
changeDisplayName
(
newName
);
tablePart
.
changeDisplayName
(
newName
);
...
...
cell/view/WorkbookView.js
View file @
7bea6f90
...
@@ -2813,10 +2813,12 @@
...
@@ -2813,10 +2813,12 @@
color
=
null
;
color
=
null
;
if
(
styleOptions
.
totalRow
&&
styleOptions
.
totalRow
.
dxf
.
fill
&&
null
!=
styleOptions
.
totalRow
.
dxf
.
fill
.
bg
)
if
(
styleOptions
.
totalRow
&&
styleOptions
.
totalRow
.
dxf
.
fill
&&
null
!=
styleOptions
.
totalRow
.
dxf
.
fill
.
bg
)
color
=
styleOptions
.
totalRow
.
dxf
.
fill
.
bg
;
color
=
styleOptions
.
totalRow
.
dxf
.
fill
.
bg
;
else
color
=
defaultColorBackground
;
if
(
color
!==
null
)
{
ctx
.
setFillStyle
(
color
);
ctx
.
setFillStyle
(
color
);
ctx
.
fillRect
(
0
,
stepY
*
4
,
xSize
,
stepY
);
ctx
.
fillRect
(
0
,
stepY
*
4
,
xSize
,
stepY
);
}
}
}
...
...
cell/view/WorksheetView.js
View file @
7bea6f90
...
@@ -12813,8 +12813,12 @@
...
@@ -12813,8 +12813,12 @@
var
isChangeTableInfo
=
this
.
af_checkChangeTableInfo
(
tablePart
,
optionType
);
var
isChangeTableInfo
=
this
.
af_checkChangeTableInfo
(
tablePart
,
optionType
);
if
(
isChangeTableInfo
!==
false
)
if
(
isChangeTableInfo
!==
false
)
{
{
var
callback
=
function
()
var
callback
=
function
(
isSuccess
)
{
{
if
(
false
===
isSuccess
)
{
return
;
}
History
.
Create_NewPoint
();
History
.
Create_NewPoint
();
History
.
StartTransaction
();
History
.
StartTransaction
();
t
.
model
.
autoFilters
.
changeFormatTableInfo
(
tableName
,
optionType
,
val
);
t
.
model
.
autoFilters
.
changeFormatTableInfo
(
tableName
,
optionType
,
val
);
...
@@ -12971,7 +12975,11 @@
...
@@ -12971,7 +12975,11 @@
return
;
return
;
}
}
var
callback
=
function
()
{
var
callback
=
function
(
isSuccess
)
{
if
(
false
===
isSuccess
)
{
return
;
}
History
.
Create_NewPoint
();
History
.
Create_NewPoint
();
History
.
StartTransaction
();
History
.
StartTransaction
();
...
@@ -13171,17 +13179,27 @@
...
@@ -13171,17 +13179,27 @@
WorksheetView
.
prototype
.
af_changeTableRange
=
function
(
tableName
,
range
)
WorksheetView
.
prototype
.
af_changeTableRange
=
function
(
tableName
,
range
)
{
{
var
t
=
this
;
range
=
Asc
.
g_oRangeCache
.
getAscRange
(
range
);
var
callback
=
function
(
isSuccess
)
{
if
(
false
===
isSuccess
)
{
return
;
}
History
.
Create_NewPoint
();
History
.
Create_NewPoint
();
History
.
StartTransaction
();
History
.
StartTransaction
();
range
=
Asc
.
g_oRangeCache
.
getAscRange
(
range
);
t
.
model
.
autoFilters
.
changeTableRange
(
tableName
,
range
);
this
.
model
.
autoFilters
.
changeTableRange
(
tableName
,
range
);
this
.
_onUpdateFormatTable
(
range
,
false
,
true
);
t
.
_onUpdateFormatTable
(
range
,
false
,
true
);
//TODO добавить перерисовку таблицы и перерисовку шаблонов
//TODO добавить перерисовку таблицы и перерисовку шаблонов
History
.
EndTransaction
();
History
.
EndTransaction
();
};
};
t
.
_isLockedCells
(
range
,
null
,
callback
);
};
WorksheetView
.
prototype
.
af_checkChangeRange
=
function
(
range
)
WorksheetView
.
prototype
.
af_checkChangeRange
=
function
(
range
)
{
{
var
res
=
null
;
var
res
=
null
;
...
...
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