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
a0b3b0b4
Commit
a0b3b0b4
authored
Apr 05, 2016
by
GoshaZotov
Committed by
Alexander.Trofimov
May 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
for check range before change format table range
parent
faf10bd5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
43 deletions
+30
-43
cell/api.js
cell/api.js
+1
-1
cell/apiDefines.js
cell/apiDefines.js
+2
-1
cell/model/autofilters.js
cell/model/autofilters.js
+5
-0
cell/view/WorkbookView.js
cell/view/WorkbookView.js
+2
-2
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+15
-39
common/editorscommon.js
common/editorscommon.js
+5
-0
No files found.
cell/api.js
View file @
a0b3b0b4
...
...
@@ -3395,7 +3395,7 @@ var editor;
prot
[
"
asc_insertCellsInTable
"
]
=
prot
.
asc_insertCellsInTable
;
prot
[
"
asc_deleteCellsInTable
"
]
=
prot
.
asc_deleteCellsInTable
;
prot
[
"
asc_changeDisplayNameTable
"
]
=
prot
.
asc_changeDisplayNameTable
;
prot
[
"
a
f_changeTableRange
"
]
=
prot
.
af
_changeTableRange
;
prot
[
"
a
sc_changeTableRange
"
]
=
prot
.
asc
_changeTableRange
;
prot
[
"
asc_getTablePictures
"
]
=
prot
.
asc_getTablePictures
;
// Drawing objects interface
...
...
cell/apiDefines.js
View file @
a0b3b0b4
...
...
@@ -102,7 +102,8 @@ var c_oAscSelectionDialogType = {
None
:
0
,
FormatTable
:
1
,
Chart
:
2
,
DefinedName
:
3
DefinedName
:
3
,
FormatTableChangeRange
:
4
};
var
c_oAscGraphicOption
=
{
...
...
cell/model/autofilters.js
View file @
a0b3b0b4
...
...
@@ -2215,6 +2215,11 @@
History
.
EndTransaction
();
},
changeTableRange
:
function
(
tableName
,
range
)
{
},
_clearRange
:
function
(
range
,
isClearText
)
{
range
.
setTableStyle
(
null
);
...
...
cell/view/WorkbookView.js
View file @
a0b3b0b4
...
...
@@ -2659,8 +2659,8 @@
ShowFirstColumn
:
false
,
ShowLastColumn
:
false
,
ShowRowStripes
:
true
,
HeaderRowCount
:
null
,
TotalsRowCount
:
0
HeaderRowCount
:
true
,
TotalsRowCount
:
false
};
}
...
...
cell/view/WorksheetView.js
View file @
a0b3b0b4
...
...
@@ -13179,52 +13179,28 @@
WorksheetView
.
prototype
.
af_changeTableRange
=
function
(
tableName
,
range
)
{
var
tablePart
=
this
.
model
.
autoFilters
.
_getFilterByDisplayName
(
tableName
);
if
(
!
tablePart
||
(
tablePart
&&
!
tablePart
.
TableStyleInfo
))
{
return
false
;
}
History
.
Create_NewPoint
();
History
.
StartTransaction
();
this
.
model
.
autoFilters
.
changeTableRange
(
tableName
,
range
);
var
isChangeRange
=
this
.
af_checkChangeRange
(
tablePart
,
range
);
if
(
isChangeRange
!==
false
)
{
History
.
Create_NewPoint
();
History
.
StartTransaction
();
this
.
model
.
autoFilters
.
changeTableRange
(
tablePart
,
range
);
this
.
_onUpdateFormatTable
(
isChangeRange
,
false
,
true
);
//TODO добавить перерисовку таблицы и перерисовку шаблонов
History
.
EndTransaction
();
}
this
.
_onUpdateFormatTable
(
isChangeRange
,
false
,
true
);
//TODO добавить перерисовку таблицы и перерисовку шаблонов
History
.
EndTransaction
();
};
WorksheetView
.
prototype
.
af_checkChangeRange
=
function
(
tableName
,
range
)
{
var
tablePart
=
this
.
model
.
autoFilters
.
_getFilterByDisplayName
(
tableName
);
if
(
!
tablePart
||
(
tablePart
&&
!
tablePart
.
TableStyleInfo
))
{
return
false
;
}
var
res
=
true
;
WorksheetView
.
prototype
.
af_checkChangeRange
=
function
(
range
)
{
var
res
=
null
;
var
ws
=
this
.
model
;
if
(
range
.
r1
!==
tablePart
.
Ref
.
r1
)
{
ws
.
workbook
.
handlers
.
trigger
(
"
asc_onError
"
,
c_oAscError
.
ID
.
AutoFilterMoveToHiddenRangeError
,
c_oAscError
.
Level
.
NoCritical
);
res
=
false
;
var
intersectionTables
=
this
.
model
.
autoFilters
.
getTableIntersectionRange
(
range
);
if
(
!
intersectionTables
||
(
intersectionTables
&&
intersectionTables
.
length
!==
1
))
{
res
=
c_oAscError
.
ID
.
AutoFilterMoveToHiddenRangeError
;
}
else
else
if
(
range
.
r1
!==
tablePart
.
Ref
.
r1
)
{
var
intersectionTables
=
this
.
model
.
autoFilters
.
getTableIntersectionRange
(
range
);
if
(
intersectionTables
&&
intersectionTables
.
length
>
1
)
{
ws
.
workbook
.
handlers
.
trigger
(
"
asc_onError
"
,
c_oAscError
.
ID
.
AutoFilterMoveToHiddenRangeError
,
c_oAscError
.
Level
.
NoCritical
);
res
=
false
;
}
res
=
c_oAscError
.
ID
.
AutoFilterMoveToHiddenRangeError
;
}
return
res
;
...
...
common/editorscommon.js
View file @
a0b3b0b4
...
...
@@ -1583,6 +1583,11 @@ parserHelper.prototype.checkDataRange = function (model, wb, dialogType, dataRan
// ToDo убрать эту проверку, заменить на более грамотную после правки функции _searchFilters
if
(
true
===
wb
.
getWorksheet
().
model
.
autoFilters
.
isRangeIntersectionTableOrFilter
(
dataRange
))
return
Asc
.
c_oAscError
.
ID
.
AutoFilterDataRangeError
;
}
else
if
(
c_oAscSelectionDialogType
.
FormatTableChangeRange
===
dialogType
)
{
// ToDo убрать эту проверку, заменить на более грамотную после правки функции _searchFilters
var
checkChangeRange
=
wb
.
getWorksheet
().
af_checkChangeRange
(
dataRange
);
if
(
null
!==
checkChangeRange
)
return
checkChangeRange
;
}
}
return
Asc
.
c_oAscError
.
ID
.
No
;
...
...
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