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
eb6058ef
Commit
eb6058ef
authored
Jun 08, 2016
by
alexey.musinov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[mobile] сериализация для авто фильтров
parent
128181f5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
138 additions
and
1 deletion
+138
-1
cell/native/native.js
cell/native/native.js
+138
-1
No files found.
cell/native/native.js
View file @
eb6058ef
...
...
@@ -2186,6 +2186,137 @@ function asc_ReadAutoFilter(s, p) {
return
filter
;
}
function
asc_ReadAutoFilterObj
(
s
,
p
)
{
var
filter
=
new
Asc
.
AutoFilterObj
();
var
next
=
true
;
while
(
next
)
{
var
_attr
=
s
[
p
.
pos
++
];
switch
(
_attr
)
{
case
0
:
{
filter
.
asc_setType
(
s
[
p
.
pos
++
]);
break
;
}
// TODO: color, top10,
case
255
:
default
:
{
next
=
false
;
break
;
}
}
}
return
filter
;
}
function
asc_ReadAutoFiltersOptionsElements
(
s
,
p
)
{
var
filter
=
new
AscCommonExcel
.
AutoFiltersOptionsElements
();
var
next
=
true
;
while
(
next
)
{
var
_attr
=
s
[
p
.
pos
++
];
switch
(
_attr
)
{
case
0
:
{
filter
.
asc_setIsDateFormat
(
s
[
p
.
pos
++
]);
break
;
}
case
1
:
{
filter
.
asc_setText
(
s
[
p
.
pos
++
]);
break
;
}
case
2
:
{
filter
.
asc_setVal
(
s
[
p
.
pos
++
]);
break
;
}
case
3
:
{
filter
.
asc_setVisible
(
s
[
p
.
pos
++
]);
break
;
}
case
255
:
default
:
{
next
=
false
;
break
;
}
}
}
return
filter
;
}
function
asc_ReadAutoFiltersOptions
(
s
,
p
)
{
var
filter
=
new
Asc
.
AutoFiltersOptions
();
var
next
=
true
;
while
(
next
)
{
var
_attr
=
s
[
p
.
pos
++
];
switch
(
_attr
)
{
case
0
:
{
filter
.
asc_setCellId
(
s
[
p
.
pos
++
]);
break
;
}
case
1
:
{
filter
.
asc_setDiplayName
(
s
[
p
.
pos
++
]);
break
;
}
case
2
:
{
filter
.
asc_setIsTextFilter
(
s
[
p
.
pos
++
]);
break
;
}
case
3
:
{
filter
.
asc_setSortState
(
s
[
p
.
pos
++
]);
break
;
}
case
4
:
{
filter
.
asc_setSortColor
(
asc_menu_ReadColor
(
s
,
p
));
break
;
}
case
5
:
{
filter
.
asc_setFilterObj
(
asc_ReadAutoFilterObj
(
s
,
p
));
break
;
}
case
6
:
{
var
values
=
[];
var
count
=
s
[
p
.
pos
++
];
for
(
var
i
=
0
;
i
<
count
;
++
i
)
{
p
.
pos
++
;
values
.
push
(
asc_ReadAutoFiltersOptionsElements
(
s
,
p
));
}
filter
.
asc_setValues
(
values
);
}
case
255
:
default
:
{
next
=
false
;
break
;
}
}
}
return
filter
;
}
function
asc_WriteCBorder
(
i
,
c
,
s
)
{
if
(
!
c
)
return
;
...
...
@@ -3726,7 +3857,6 @@ function OfflineEditor () {
});
_api
.
asc_registerCallback
(
'
asc_onSetAFDialog
'
,
function
(
state
)
{
console
.
log
(
'
asc_onSetAFDialog
'
);
var
stream
=
global_memory_stream_menu
;
stream
[
"
ClearNoAttack
"
]();
asc_WriteAutoFiltersOptions
(
state
,
stream
);
...
...
@@ -6760,6 +6890,13 @@ function offline_apply_event(type,params) {
break
;
}
case
3020
:
// ASC_SPREADSHEETS_EVENT_TYPE_AUTO_FILTER_APPLY
{
var
autoFilter
=
asc_ReadAutoFiltersOptions
(
params
,
_current
);
_api
.
asc_applyAutoFilter
(
autoFilter
);
break
;
}
case
3040
:
// ASC_SPREADSHEETS_EVENT_TYPE_FILTER_FORMAT_TABLE_OPTIONS
{
var
formatOptions
=
_api
.
asc_getAddFormatTableOptions
(
params
);
...
...
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