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
7834eb98
Commit
7834eb98
authored
May 05, 2016
by
GoshaZotov
Committed by
Alexander.Trofimov
May 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add functions asc_setSortColor and asc_getSortColor
parent
418d775c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
60 deletions
+83
-60
cell/model/autofilters.js
cell/model/autofilters.js
+62
-56
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+21
-4
No files found.
cell/model/autofilters.js
View file @
7834eb98
...
@@ -137,6 +137,7 @@
...
@@ -137,6 +137,7 @@
this
.
isTextFilter
=
null
;
this
.
isTextFilter
=
null
;
this
.
colorsFill
=
null
;
this
.
colorsFill
=
null
;
this
.
colorsFont
=
null
;
this
.
colorsFont
=
null
;
this
.
sortColor
=
null
;
return
this
;
return
this
;
}
}
...
@@ -159,6 +160,7 @@
...
@@ -159,6 +160,7 @@
case
this
.
Properties
.
isTextFilter
:
return
this
.
isTextFilter
;
break
;
case
this
.
Properties
.
isTextFilter
:
return
this
.
isTextFilter
;
break
;
case
this
.
Properties
.
colorsFill
:
return
this
.
colorsFill
;
break
;
case
this
.
Properties
.
colorsFill
:
return
this
.
colorsFill
;
break
;
case
this
.
Properties
.
colorsFont
:
return
this
.
colorsFont
;
break
;
case
this
.
Properties
.
colorsFont
:
return
this
.
colorsFont
;
break
;
case
this
.
Properties
.
sortColor
:
return
this
.
sortColor
;
break
;
}
}
return
null
;
return
null
;
...
@@ -173,6 +175,7 @@
...
@@ -173,6 +175,7 @@
case
this
.
Properties
.
isTextFilter
:
this
.
IsTextFilter
=
value
;
break
;
case
this
.
Properties
.
isTextFilter
:
this
.
IsTextFilter
=
value
;
break
;
case
this
.
Properties
.
colorsFill
:
this
.
colorsFill
=
value
;
break
;
case
this
.
Properties
.
colorsFill
:
this
.
colorsFill
=
value
;
break
;
case
this
.
Properties
.
colorsFont
:
this
.
colorsFont
=
value
;
break
;
case
this
.
Properties
.
colorsFont
:
this
.
colorsFont
=
value
;
break
;
case
this
.
Properties
.
sortColor
:
this
.
sortColor
=
value
;
break
;
}
}
},
},
...
@@ -187,16 +190,18 @@
...
@@ -187,16 +190,18 @@
asc_setIsTextFilter
:
function
(
val
)
{
this
.
isTextFilter
=
val
;
},
asc_setIsTextFilter
:
function
(
val
)
{
this
.
isTextFilter
=
val
;
},
asc_setColorsFill
:
function
(
val
)
{
this
.
colorsFill
=
val
;
},
asc_setColorsFill
:
function
(
val
)
{
this
.
colorsFill
=
val
;
},
asc_setColorsFont
:
function
(
val
)
{
this
.
colorsFont
=
val
;
},
asc_setColorsFont
:
function
(
val
)
{
this
.
colorsFont
=
val
;
},
asc_setSortColor
:
function
(
val
)
{
this
.
sortColor
=
val
;
},
asc_getCellId
:
function
()
{
return
this
.
cellId
;
},
asc_getCellId
:
function
()
{
return
this
.
cellId
;
},
asc_getValues
:
function
()
{
return
this
.
values
;
},
asc_getValues
:
function
()
{
return
this
.
values
;
},
asc_getFilterObj
:
function
()
{
return
this
.
filter
;
},
asc_getFilterObj
:
function
()
{
return
this
.
filter
;
},
asc_getSortState
:
function
()
{
return
this
.
sortVal
;
},
asc_getSortState
:
function
()
{
return
this
.
sortVal
;
},
asc_getDisplayName
:
function
(
val
)
{
return
this
.
displayName
;
},
asc_getDisplayName
:
function
()
{
return
this
.
displayName
;
},
asc_getIsTextFilter
:
function
(
val
)
{
return
this
.
isTextFilter
;
},
asc_getIsTextFilter
:
function
()
{
return
this
.
isTextFilter
;
},
asc_getColorsFill
:
function
(
val
)
{
return
this
.
colorsFill
;
},
asc_getColorsFill
:
function
()
{
return
this
.
colorsFill
;
},
asc_getColorsFont
:
function
(
val
)
{
return
this
.
colorsFont
;
}
asc_getColorsFont
:
function
()
{
return
this
.
colorsFont
;
},
asc_getSortColor
:
function
()
{
return
this
.
sortColor
;
}
};
};
var
g_oAutoFilterObj
=
{
var
g_oAutoFilterObj
=
{
...
@@ -2414,39 +2419,39 @@
...
@@ -2414,39 +2419,39 @@
}
}
return
res
;
return
res
;
},
},
_getColIdColumn
:
function
(
filter
,
cellId
)
_getColIdColumn
:
function
(
filter
,
cellId
)
{
{
var
res
=
null
;
var
res
=
null
;
var
autoFilter
=
filter
&&
filter
.
getType
()
===
g_nFiltersType
.
tablePart
?
filter
.
AutoFilter
:
filter
;
var
autoFilter
=
filter
&&
filter
.
getType
()
===
g_nFiltersType
.
tablePart
?
filter
.
AutoFilter
:
filter
;
if
(
autoFilter
&&
autoFilter
.
FilterColumns
&&
autoFilter
.
FilterColumns
.
length
)
if
(
autoFilter
&&
autoFilter
.
FilterColumns
&&
autoFilter
.
FilterColumns
.
length
)
{
{
var
rangeCellId
=
this
.
_idToRange
(
cellId
);
var
rangeCellId
=
this
.
_idToRange
(
cellId
);
var
colId
=
autoFilter
.
Ref
.
c2
-
rangeCellId
.
c1
;
var
colId
=
autoFilter
.
Ref
.
c2
-
rangeCellId
.
c1
;
res
=
this
.
_getTrueColId
(
filter
,
colId
);
res
=
this
.
_getTrueColId
(
filter
,
colId
);
}
}
return
res
;
return
res
;
},
},
_getIndexByColId
:
function
(
autoFilter
,
cellId
)
_getIndexByColId
:
function
(
autoFilter
,
cellId
)
{
{
var
res
=
null
;
var
res
=
null
;
for
(
var
i
=
0
;
i
<
autoFilter
.
FilterColumns
.
length
;
i
++
)
for
(
var
i
=
0
;
i
<
autoFilter
.
FilterColumns
.
length
;
i
++
)
{
{
if
(
autoFilter
.
FilterColumns
[
i
].
ColId
===
colId
)
if
(
autoFilter
.
FilterColumns
[
i
].
ColId
===
colId
)
{
{
index
=
i
;
index
=
i
;
break
;
break
;
}
}
}
}
return
res
;
return
res
;
},
},
_hiddenAnotherFilter
:
function
(
filterColumns
,
cellId
,
r
,
c
)
_hiddenAnotherFilter
:
function
(
filterColumns
,
cellId
,
r
,
c
)
...
@@ -4324,24 +4329,24 @@
...
@@ -4324,24 +4329,24 @@
return
oldFilter
.
Ref
;
return
oldFilter
.
Ref
;
},
},
clearFilterColumn
:
function
(
cellId
,
displayName
)
clearFilterColumn
:
function
(
cellId
,
displayName
)
{
{
var
filter
=
this
.
_getFilterByDisplayName
(
displayName
);
var
filter
=
this
.
_getFilterByDisplayName
(
displayName
);
var
autoFilter
=
filter
&&
filter
.
getType
()
===
g_nFiltersType
.
tablePart
?
filter
.
AutoFilter
:
filter
;
var
autoFilter
=
filter
&&
filter
.
getType
()
===
g_nFiltersType
.
tablePart
?
filter
.
AutoFilter
:
filter
;
var
colId
=
this
.
_getColIdColumn
(
filter
,
cellId
);
var
colId
=
this
.
_getColIdColumn
(
filter
,
cellId
);
if
(
colId
!==
null
)
if
(
colId
!==
null
)
{
{
var
index
=
this
.
_getIndexByColId
(
filter
,
colId
);
var
index
=
this
.
_getIndexByColId
(
filter
,
colId
);
this
.
_openHiddenRowsAfterDeleteColumn
(
autoFilter
,
colId
);
this
.
_openHiddenRowsAfterDeleteColumn
(
autoFilter
,
colId
);
autoFilter
.
FilterColumns
.
splice
(
index
,
1
);
autoFilter
.
FilterColumns
.
splice
(
index
,
1
);
}
}
return
filter
.
Ref
;
return
filter
.
Ref
;
},
},
_checkValueInCells
:
function
(
n
,
k
,
cloneActiveRange
)
_checkValueInCells
:
function
(
n
,
k
,
cloneActiveRange
)
{
{
...
@@ -4710,7 +4715,8 @@
...
@@ -4710,7 +4715,8 @@
prot
[
"
asc_getIsTextFilter
"
]
=
prot
.
asc_getIsTextFilter
;
prot
[
"
asc_getIsTextFilter
"
]
=
prot
.
asc_getIsTextFilter
;
prot
[
"
asc_getColorsFill
"
]
=
prot
.
asc_getColorsFill
;
prot
[
"
asc_getColorsFill
"
]
=
prot
.
asc_getColorsFill
;
prot
[
"
asc_getColorsFont
"
]
=
prot
.
asc_getColorsFont
;
prot
[
"
asc_getColorsFont
"
]
=
prot
.
asc_getColorsFont
;
prot
[
"
asc_getSortColor
"
]
=
prot
.
asc_getSortColor
;
window
[
"
AscCommonExcel
"
].
AutoFilterObj
=
AutoFilterObj
;
window
[
"
AscCommonExcel
"
].
AutoFilterObj
=
AutoFilterObj
;
prot
=
AutoFilterObj
.
prototype
;
prot
=
AutoFilterObj
.
prototype
;
prot
[
"
asc_getType
"
]
=
prot
.
asc_getType
;
prot
[
"
asc_getType
"
]
=
prot
.
asc_getType
;
...
...
cell/view/WorksheetView.js
View file @
7834eb98
...
@@ -12674,22 +12674,27 @@
...
@@ -12674,22 +12674,27 @@
filterObj
.
type
=
c_oAscAutoFilterTypes
.
Filters
;
filterObj
.
type
=
c_oAscAutoFilterTypes
.
Filters
;
//get sort
//get sort
var
sortVal
=
false
;
var
sortVal
=
null
;
var
sortColor
=
null
;
if
(
filter
&&
filter
.
SortState
&&
filter
.
SortState
.
SortConditions
&&
filter
.
SortState
.
SortConditions
[
0
])
if
(
filter
&&
filter
.
SortState
&&
filter
.
SortState
.
SortConditions
&&
filter
.
SortState
.
SortConditions
[
0
])
{
{
if
(
rangeButton
.
r1
==
filter
.
SortState
.
SortConditions
[
0
].
Ref
.
r1
&&
rangeButton
.
c1
==
filter
.
SortState
.
SortConditions
[
0
].
Ref
.
c1
)
var
SortConditions
=
filter
.
SortState
.
SortConditions
[
0
];
if
(
rangeButton
.
r1
==
SortConditions
.
Ref
.
r1
&&
rangeButton
.
c1
==
SortConditions
.
Ref
.
c1
)
{
{
var
conditionSortBy
=
filter
.
SortState
.
SortConditions
[
0
].
ConditionSortBy
;
var
conditionSortBy
=
SortConditions
.
ConditionSortBy
;
switch
(
conditionSortBy
)
switch
(
conditionSortBy
)
{
{
case
Asc
.
ESortBy
.
sortbyCellColor
:
case
Asc
.
ESortBy
.
sortbyCellColor
:
{
{
sortVal
=
Asc
.
c_oAscSortOptions
.
ByColorFill
;
sortVal
=
Asc
.
c_oAscSortOptions
.
ByColorFill
;
sortColor
=
SortConditions
.
dxf
&&
SortConditions
.
dxf
.
fill
?
SortConditions
.
dxf
.
fill
.
bg
:
null
;
break
;
break
;
}
}
case
Asc
.
ESortBy
.
sortbyFontColor
:
case
Asc
.
ESortBy
.
sortbyFontColor
:
{
{
sortVal
=
Asc
.
c_oAscSortOptions
.
ByColorFont
;
sortVal
=
Asc
.
c_oAscSortOptions
.
ByColorFont
;
sortColor
=
SortConditions
.
dxf
&&
SortConditions
.
dxf
.
font
?
SortConditions
.
dxf
.
font
.
c
:
null
;
break
;
break
;
}
}
default
:
default
:
...
@@ -12698,13 +12703,24 @@
...
@@ -12698,13 +12703,24 @@
sortVal
=
Asc
.
c_oAscSortOptions
.
Descending
;
sortVal
=
Asc
.
c_oAscSortOptions
.
Descending
;
else
else
sortVal
=
Asc
.
c_oAscSortOptions
.
Ascending
;
sortVal
=
Asc
.
c_oAscSortOptions
.
Ascending
;
break
;
break
;
}
}
}
}
}
}
}
}
var
ascColor
=
null
;
if
(
null
!==
sortColor
)
{
ascColor
=
new
Asc
.
asc_CColor
();
ascColor
.
asc_putR
(
sortColor
.
getR
());
ascColor
.
asc_putG
(
sortColor
.
getG
());
ascColor
.
asc_putB
(
sortColor
.
getB
());
ascColor
.
asc_putA
(
sortColor
.
getA
());
}
//set menu object
//set menu object
var
autoFilterObject
=
new
AscCommonExcel
.
AutoFiltersOptions
();
var
autoFilterObject
=
new
AscCommonExcel
.
AutoFiltersOptions
();
...
@@ -12714,6 +12730,7 @@
...
@@ -12714,6 +12730,7 @@
autoFilterObject
.
asc_setFilterObj
(
filterObj
);
autoFilterObject
.
asc_setFilterObj
(
filterObj
);
autoFilterObject
.
asc_setAutomaticRowCount
(
automaticRowCount
);
autoFilterObject
.
asc_setAutomaticRowCount
(
automaticRowCount
);
autoFilterObject
.
asc_setDiplayName
(
displayName
);
autoFilterObject
.
asc_setDiplayName
(
displayName
);
autoFilterObject
.
asc_setSortColor
(
ascColor
);
var
columnRange
=
Asc
.
Range
(
rangeButton
.
c1
,
autoFilter
.
Ref
.
r1
+
1
,
rangeButton
.
c1
,
autoFilter
.
Ref
.
r2
);
var
columnRange
=
Asc
.
Range
(
rangeButton
.
c1
,
autoFilter
.
Ref
.
r1
+
1
,
rangeButton
.
c1
,
autoFilter
.
Ref
.
r2
);
...
...
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