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
a63b6487
Commit
a63b6487
authored
Mar 28, 2016
by
GoshaZotov
Committed by
Alexander.Trofimov
May 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add function af_changeSelectionFormatTable(for change selection table from menu)
parent
6ca440df
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
4 deletions
+76
-4
cell/apiDefines.js
cell/apiDefines.js
+7
-0
cell/model/Workbook.js
cell/model/Workbook.js
+4
-3
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+65
-1
No files found.
cell/apiDefines.js
View file @
a63b6487
...
@@ -176,6 +176,13 @@ var c_oAscChangeFilterOptions = {
...
@@ -176,6 +176,13 @@ var c_oAscChangeFilterOptions = {
style
:
2
style
:
2
};
};
var
c_oAscChangeSelectionFormatTable
=
{
all
:
1
,
data
:
2
,
row
:
3
,
column
:
4
};
// Состояние редактора ячейки
// Состояние редактора ячейки
var
c_oAscCellEditorState
=
{
var
c_oAscCellEditorState
=
{
editEnd
:
0
,
// Окончание редактирования
editEnd
:
0
,
// Окончание редактирования
...
...
cell/model/Workbook.js
View file @
a63b6487
...
@@ -8294,6 +8294,7 @@ Range.prototype.sort=function(nOption, nStartCol, colorText, colorFill){
...
@@ -8294,6 +8294,7 @@ Range.prototype.sort=function(nOption, nStartCol, colorText, colorFill){
nStartCol
=
merged
.
bbox
.
c1
;
nStartCol
=
merged
.
bbox
.
c1
;
}
}
lockDraw
(
this
.
worksheet
.
workbook
);
lockDraw
(
this
.
worksheet
.
workbook
);
var
isSortColor
=
!!
(
colorText
||
colorFill
);
var
oRes
=
null
;
var
oRes
=
null
;
var
oThis
=
this
;
var
oThis
=
this
;
var
bAscent
=
false
;
var
bAscent
=
false
;
...
@@ -8364,7 +8365,7 @@ Range.prototype.sort=function(nOption, nStartCol, colorText, colorFill){
...
@@ -8364,7 +8365,7 @@ Range.prototype.sort=function(nOption, nStartCol, colorText, colorFill){
sText
=
val
;
sText
=
val
;
aSortElems
.
push
({
row
:
nRow0
,
num
:
nNumber
,
text
:
sText
,
colorFill
:
colorFillCell
,
colorsText
:
colorsTextCell
});
aSortElems
.
push
({
row
:
nRow0
,
num
:
nNumber
,
text
:
sText
,
colorFill
:
colorFillCell
,
colorsText
:
colorsTextCell
});
}
}
else
if
(
colorFill
||
colorText
)
else
if
(
isSortColor
)
{
{
aSortElems
.
push
({
row
:
nRow0
,
num
:
nNumber
,
text
:
sText
,
colorFill
:
colorFillCell
,
colorsText
:
colorsTextCell
});
aSortElems
.
push
({
row
:
nRow0
,
num
:
nNumber
,
text
:
sText
,
colorFill
:
colorFillCell
,
colorsText
:
colorsTextCell
});
}
}
...
@@ -8421,7 +8422,7 @@ Range.prototype.sort=function(nOption, nStartCol, colorText, colorFill){
...
@@ -8421,7 +8422,7 @@ Range.prototype.sort=function(nOption, nStartCol, colorText, colorFill){
return
res
;
return
res
;
};
};
if
(
colorText
||
colorFill
)
if
(
isSortColor
)
{
{
var
newArrayNeedColor
=
[];
var
newArrayNeedColor
=
[];
var
newArrayAnotherColor
=
[];
var
newArrayAnotherColor
=
[];
...
...
cell/view/WorksheetView.js
View file @
a63b6487
...
@@ -12705,6 +12705,70 @@
...
@@ -12705,6 +12705,70 @@
return
true
;
return
true
;
};
};
WorksheetView
.
prototype
.
af_changeSelectionFormatTable
=
function
(
optionType
,
tableName
)
{
var
t
=
this
;
var
ws
=
this
.
model
;
var
tablePart
=
ws
.
_getFilterByDisplayName
(
tableName
);
if
(
!
tablePart
||
!
(
tablePart
&&
tablePart
.
Ref
))
{
return
false
;
}
var
refTablePart
=
tablePart
.
Ref
;
var
startCol
=
this
.
activeRange
.
c1
;
var
endCol
=
this
.
activeRange
.
c2
;
var
startRow
=
this
.
activeRange
.
r1
;
var
endRow
=
this
.
activeRange
.
r2
;
var
newActiveRange
;
switch
(
optionType
)
{
case
c_oAscChangeSelectionFilter
.
all
:
{
startCol
=
refTablePart
.
c1
;
endCol
=
refTablePart
.
c2
;
startRow
=
refTablePart
.
r1
;
endRow
=
refTablePart
.
r2
;
break
;
}
case
c_oAscChangeSelectionFilter
.
data
:
{
//TODO проверить есть ли строка заголовков
startCol
=
refTablePart
.
c1
;
endCol
=
refTablePart
.
c2
;
startRow
=
refTablePart
.
r1
+
1
;
endRow
=
refTablePart
.
r2
;
break
;
}
case
c_oAscChangeSelectionFilter
.
row
:
{
startCol
=
refTablePart
.
c1
;
endCol
=
refTablePart
.
c2
;
startRow
=
this
.
activeRange
.
r1
<
refTablePart
.
r1
?
refTablePart
.
r1
:
this
.
activeRange
.
r1
;
endRow
=
this
.
activeRange
.
r2
>
refTablePart
.
r2
?
refTablePart
.
r2
:
this
.
activeRange
.
r2
;
break
;
}
case
c_oAscChangeSelectionFilter
.
column
:
{
startCol
=
this
.
activeRange
.
c1
<
refTablePart
.
c1
?
refTablePart
.
c1
:
this
.
activeRange
.
c1
;
endCol
=
this
.
activeRange
.
c2
>
refTablePart
.
r2
?
refTablePart
.
r2
:
this
.
activeRange
.
r2
;
startRow
=
refTablePart
.
r1
;
endRow
=
refTablePart
.
r2
;
break
;
}
}
t
.
setSelection
(
new
Asc
.
Range
(
startCol
,
startRow
,
endCol
,
endRow
));
};
/*
/*
* Export
* Export
* -----------------------------------------------------------------------------
* -----------------------------------------------------------------------------
...
...
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