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
ea26cf6b
Commit
ea26cf6b
authored
Apr 27, 2016
by
GoshaZotov
Committed by
Alexander.Trofimov
May 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add function af_getFilterTypes(for definition color/text/digit data in filter column)
parent
d3da4cd0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
3 deletions
+85
-3
cell/model/autofilters.js
cell/model/autofilters.js
+10
-2
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+75
-1
No files found.
cell/model/autofilters.js
View file @
ea26cf6b
...
@@ -119,7 +119,8 @@
...
@@ -119,7 +119,8 @@
values
:
1
,
values
:
1
,
filter
:
2
,
filter
:
2
,
automaticRowCount
:
3
,
automaticRowCount
:
3
,
displayName
:
4
displayName
:
4
,
isTextFilter
:
5
};
};
function
AutoFiltersOptions
()
{
function
AutoFiltersOptions
()
{
...
@@ -133,6 +134,8 @@
...
@@ -133,6 +134,8 @@
this
.
sortVal
=
null
;
this
.
sortVal
=
null
;
this
.
automaticRowCount
=
null
;
this
.
automaticRowCount
=
null
;
this
.
displayName
=
null
;
this
.
displayName
=
null
;
this
.
isTextFilter
=
null
;
return
this
;
return
this
;
}
}
...
@@ -152,6 +155,7 @@
...
@@ -152,6 +155,7 @@
case
this
.
Properties
.
filter
:
return
this
.
filter
;
break
;
case
this
.
Properties
.
filter
:
return
this
.
filter
;
break
;
case
this
.
Properties
.
automaticRowCount
:
return
this
.
automaticRowCount
;
break
;
case
this
.
Properties
.
automaticRowCount
:
return
this
.
automaticRowCount
;
break
;
case
this
.
Properties
.
displayName
:
return
this
.
displayName
;
break
;
case
this
.
Properties
.
displayName
:
return
this
.
displayName
;
break
;
case
this
.
Properties
.
isTextFilter
:
return
this
.
isTextFilter
;
break
;
}
}
return
null
;
return
null
;
...
@@ -163,6 +167,7 @@
...
@@ -163,6 +167,7 @@
case
this
.
Properties
.
filter
:
this
.
filter
=
value
;
break
;
case
this
.
Properties
.
filter
:
this
.
filter
=
value
;
break
;
case
this
.
Properties
.
automaticRowCount
:
this
.
automaticRowCount
=
value
;
break
;
case
this
.
Properties
.
automaticRowCount
:
this
.
automaticRowCount
=
value
;
break
;
case
this
.
Properties
.
displayName
:
this
.
displayName
=
value
;
break
;
case
this
.
Properties
.
displayName
:
this
.
displayName
=
value
;
break
;
case
this
.
Properties
.
isTextFilter
:
this
.
IsTextFilter
=
value
;
break
;
}
}
},
},
...
@@ -174,13 +179,15 @@
...
@@ -174,13 +179,15 @@
asc_setAutomaticRowCount
:
function
(
val
)
{
this
.
automaticRowCount
=
val
;
},
asc_setAutomaticRowCount
:
function
(
val
)
{
this
.
automaticRowCount
=
val
;
},
asc_setDiplayName
:
function
(
val
)
{
this
.
displayName
=
val
;
},
asc_setDiplayName
:
function
(
val
)
{
this
.
displayName
=
val
;
},
asc_setIsTextFilter
:
function
(
val
)
{
this
.
isTextFilter
=
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
(
val
)
{
return
this
.
displayName
;
},
asc_getIsTextFilter
:
function
(
val
)
{
return
this
.
IsTextFilter
;
},
};
};
var
g_oAutoFilterObj
=
{
var
g_oAutoFilterObj
=
{
...
@@ -4641,6 +4648,7 @@
...
@@ -4641,6 +4648,7 @@
prot
[
"
asc_getFilterObj
"
]
=
prot
.
asc_getFilterObj
;
prot
[
"
asc_getFilterObj
"
]
=
prot
.
asc_getFilterObj
;
prot
[
"
asc_getCellId
"
]
=
prot
.
asc_getCellId
;
prot
[
"
asc_getCellId
"
]
=
prot
.
asc_getCellId
;
prot
[
"
asc_getDisplayName
"
]
=
prot
.
asc_getDisplayName
;
prot
[
"
asc_getDisplayName
"
]
=
prot
.
asc_getDisplayName
;
prot
[
"
asc_getIsTextFilter
"
]
=
prot
.
asc_getIsTextFilter
;
window
[
"
AscCommonExcel
"
].
AutoFilterObj
=
AutoFilterObj
;
window
[
"
AscCommonExcel
"
].
AutoFilterObj
=
AutoFilterObj
;
prot
=
AutoFilterObj
.
prototype
;
prot
=
AutoFilterObj
.
prototype
;
...
...
cell/view/WorksheetView.js
View file @
ea26cf6b
...
@@ -12679,9 +12679,83 @@
...
@@ -12679,9 +12679,83 @@
autoFilterObject
.
asc_setAutomaticRowCount
(
automaticRowCount
);
autoFilterObject
.
asc_setAutomaticRowCount
(
automaticRowCount
);
autoFilterObject
.
asc_setDiplayName
(
displayName
);
autoFilterObject
.
asc_setDiplayName
(
displayName
);
var
columnRange
=
Asc
.
Range
(
rangeButton
.
c1
,
autoFilter
.
Ref
.
r1
+
1
,
rangeButton
.
c1
,
autoFilter
.
Ref
.
r2
);
var
filterTypes
=
this
.
af_getFilterTypes
(
columnRange
);
autoFilterObject
.
asc_setIsTextFilter
(
filterTypes
.
text
);
this
.
handlers
.
trigger
(
"
setAutoFiltersDialog
"
,
autoFilterObject
);
this
.
handlers
.
trigger
(
"
setAutoFiltersDialog
"
,
autoFilterObject
);
};
};
WorksheetView
.
prototype
.
af_getFilterTypes
=
function
(
columnRange
)
{
var
t
=
this
;
var
ws
=
this
.
model
;
var
res
=
{
text
:
true
,
colors
:
[],
fontColors
:
[]};
var
tempText
=
0
,
tempDigit
=
0
;
var
alreadyAddColors
=
{},
alreadyAddFontColors
=
{};
for
(
var
i
=
columnRange
.
r1
;
i
<=
columnRange
.
r2
;
i
++
)
{
var
cell
=
ws
.
_getCellNoEmpty
(
i
,
columnRange
.
c1
);
if
(
!
cell
)
{
continue
;
}
if
(
cell
.
isEmptyText
()
===
false
)
{
var
type
=
cell
.
getType
();
if
(
type
===
0
)
{
tempDigit
++
;
}
else
{
tempText
++
;
}
}
if
(
cell
.
oValue
.
multiText
!==
null
)
{
for
(
var
j
=
0
;
j
<
cell
.
oValue
.
multiText
.
length
;
j
++
)
{
var
fontColor
=
cell
.
oValue
.
multiText
[
j
].
format
?
cell
.
oValue
.
multiText
[
j
].
format
.
c
:
null
;
if
(
fontColor
!==
null
&&
alreadyAddFontColors
[
fontColor
.
rgb
]
!==
true
&&
g_oColorManager
.
isEqual
(
fontColor
,
g_oDefaultFont
.
c
)
===
false
)
{
res
.
fontColors
.
push
(
fontColor
);
alreadyAddFontColors
[
fontColor
.
rgb
]
=
true
;
}
}
}
else
{
var
fontColor
=
cell
.
xfs
&&
cell
.
xfs
.
font
?
cell
.
xfs
.
font
.
c
:
null
;
if
(
fontColor
!==
null
&&
alreadyAddFontColors
[
fontColor
.
rgb
]
!==
true
&&
g_oColorManager
.
isEqual
(
fontColor
,
g_oDefaultFont
.
c
)
===
false
)
{
res
.
fontColors
.
push
(
fontColor
);
alreadyAddFontColors
[
fontColor
.
rgb
]
=
true
;
}
}
var
color
=
cell
.
getStyle
();
if
(
color
!==
null
&&
color
.
fill
&&
color
.
fill
.
bg
&&
alreadyAddColors
[
color
.
fill
.
bg
.
rgb
]
!==
true
)
{
res
.
colors
.
push
(
color
.
fill
);
alreadyAddColors
[
color
.
fill
.
bg
.
rgb
]
=
true
;
}
}
if
(
tempDigit
>
tempText
)
{
res
.
text
=
false
;
}
return
res
;
};
WorksheetView
.
prototype
.
af_changeSelectionTablePart
=
function
(
activeRange
)
WorksheetView
.
prototype
.
af_changeSelectionTablePart
=
function
(
activeRange
)
{
{
var
t
=
this
;
var
t
=
this
;
...
...
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