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
5a0f3f84
Commit
5a0f3f84
authored
May 05, 2016
by
GoshaZotov
Committed by
Alexander.Trofimov
May 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add color sort
parent
25832f7f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
12 deletions
+17
-12
cell/api.js
cell/api.js
+2
-2
cell/apiDefines.js
cell/apiDefines.js
+3
-1
cell/model/Workbook.js
cell/model/Workbook.js
+5
-2
cell/model/autofilters.js
cell/model/autofilters.js
+2
-3
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+5
-4
No files found.
cell/api.js
View file @
5a0f3f84
...
...
@@ -553,9 +553,9 @@ var editor;
ws
.
applyAutoFilter
(
autoFilterObject
);
};
spreadsheet_api
.
prototype
.
asc_sortColFilter
=
function
(
type
,
cellId
,
displayName
)
{
spreadsheet_api
.
prototype
.
asc_sortColFilter
=
function
(
type
,
cellId
,
displayName
,
color
)
{
var
ws
=
this
.
wb
.
getWorksheet
();
ws
.
sortColFilter
(
type
,
cellId
,
displayName
);
ws
.
sortColFilter
(
type
,
cellId
,
displayName
,
color
);
};
spreadsheet_api
.
prototype
.
asc_getAddFormatTableOptions
=
function
(
range
)
{
...
...
cell/apiDefines.js
View file @
5a0f3f84
...
...
@@ -37,7 +37,9 @@ var c_oAscMergeOptions = {
var
c_oAscSortOptions
=
{
Ascending
:
1
,
Descending
:
2
Descending
:
2
,
ByColorFill
:
3
,
ByColorFont
:
4
};
var
c_oAscBorderOptions
=
{
...
...
cell/model/Workbook.js
View file @
5a0f3f84
...
...
@@ -8563,7 +8563,7 @@ Range.prototype.cleanHyperlinks=function(){
this
.
removeHyperlink
(
aHyperlinks
.
inner
[
i
].
data
);
History
.
EndTransaction
();
};
Range
.
prototype
.
sort
=
function
(
nOption
,
nStartCol
,
color
Text
,
colorFill
){
Range
.
prototype
.
sort
=
function
(
nOption
,
nStartCol
,
color
){
//todo горизонтальная сортировка
var
aMerged
=
this
.
worksheet
.
mergeManager
.
get
(
this
.
bbox
);
if
(
aMerged
.
outer
.
length
>
0
||
(
aMerged
.
inner
.
length
>
0
&&
null
==
_isSameSizeMerged
(
this
.
bbox
,
aMerged
.
inner
)))
...
...
@@ -8577,7 +8577,10 @@ Range.prototype.sort=function(nOption, nStartCol, colorText, colorFill){
nStartCol
=
merged
.
bbox
.
c1
;
}
this
.
worksheet
.
workbook
.
lockDraw
();
var
isSortColor
=
!!
(
colorText
||
colorFill
);
var
colorFill
=
nOption
===
AscCommonExcel
.
c_oAscSortOptions
.
ByColorFill
?
color
:
null
;
var
colorText
=
nOption
===
AscCommonExcel
.
c_oAscSortOptions
.
ByColorFont
?
color
:
null
;
var
isSortColor
=
!!
(
colorFill
||
colorText
);
var
oRes
=
null
;
var
oThis
=
this
;
var
bAscent
=
false
;
...
...
cell/model/autofilters.js
View file @
5a0f3f84
...
...
@@ -1499,7 +1499,7 @@
var
t
=
this
;
if
(
!
sortProps
)
sortProps
=
this
.
getPropForSort
(
type
,
cellId
,
activeRange
,
displayName
);
sortProps
=
this
.
getPropForSort
(
cellId
,
activeRange
,
displayName
);
curFilter
=
sortProps
.
curFilter
,
sortRange
=
sortProps
.
sortRange
,
filterRef
=
sortProps
.
filterRef
,
startCol
=
sortProps
.
startCol
,
maxFilterRow
=
sortProps
.
maxFilterRow
;
...
...
@@ -1538,13 +1538,12 @@
onSortAutoFilterCallback
();
},
getPropForSort
:
function
(
type
,
cellId
,
activeRange
,
displayName
)
getPropForSort
:
function
(
cellId
,
activeRange
,
displayName
)
{
var
worksheet
=
this
.
worksheet
;
var
t
=
this
;
var
curFilter
,
sortRange
,
filterRef
,
startCol
,
maxFilterRow
;
var
resType
=
type
==
'
ascending
'
;
var
isCellIdString
=
false
;
if
(
cellId
!==
undefined
&&
cellId
!=
""
&&
typeof
cellId
==
'
string
'
)
{
...
...
cell/view/WorksheetView.js
View file @
5a0f3f84
...
...
@@ -12009,21 +12009,22 @@
this
.
_isLockedAll
(
onChangeAutoFilterCallback
);
};
WorksheetView
.
prototype
.
sortColFilter
=
function
(
type
,
cellId
,
displayName
)
{
WorksheetView
.
prototype
.
sortColFilter
=
function
(
type
,
cellId
,
displayName
,
color
)
{
var
t
=
this
;
var
ar
=
this
.
activeRange
.
clone
(
true
);
var
onChangeAutoFilterCallback
=
function
(
isSuccess
)
{
if
(
false
===
isSuccess
)
{
return
;
}
var
sortProps
=
t
.
model
.
autoFilters
.
getPropForSort
(
type
,
cellId
,
ar
,
displayName
);
var
sortProps
=
t
.
model
.
autoFilters
.
getPropForSort
(
cellId
,
ar
,
displayName
);
var
onSortAutoFilterCallBack
=
function
()
{
History
.
Create_NewPoint
();
History
.
StartTransaction
();
t
.
cellCommentator
.
sortComments
(
sortProps
.
sortRange
.
sort
(
type
==
'
ascending
'
,
sortProps
.
startCol
));
var
sort
=
sortProps
.
sortRange
.
sort
(
type
,
sortProps
.
startCol
,
color
);
t
.
cellCommentator
.
sortComments
(
sort
);
t
.
model
.
autoFilters
.
sortColFilter
(
type
,
cellId
,
ar
,
sortProps
,
displayName
);
t
.
_onUpdateFormatTable
(
sortProps
.
sortRange
.
bbox
,
false
);
...
...
@@ -12032,7 +12033,7 @@
if
(
null
===
sortProps
)
{
t
.
setSelectionInfo
(
"
sort
"
,
type
==
'
ascending
'
);
t
.
setSelectionInfo
(
"
sort
"
,
type
);
}
else
if
(
false
!==
sortProps
)
{
...
...
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