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
7be9c66d
Commit
7be9c66d
authored
May 17, 2016
by
GoshaZotov
Committed by
Alexander.Trofimov
May 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes for reapplyAutoFilter
parent
75fc3337
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
43 deletions
+22
-43
cell/api.js
cell/api.js
+1
-1
cell/model/autofilters.js
cell/model/autofilters.js
+15
-38
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+6
-4
No files found.
cell/api.js
View file @
7be9c66d
...
...
@@ -560,7 +560,7 @@ var editor;
spreadsheet_api
.
prototype
.
asc_reapplyAutoFilter
=
function
(
displayName
)
{
var
ws
=
this
.
wb
.
getWorksheet
();
ws
.
asc_
reapplyAutoFilter
(
displayName
);
ws
.
reapplyAutoFilter
(
displayName
);
};
spreadsheet_api
.
prototype
.
asc_sortColFilter
=
function
(
type
,
cellId
,
displayName
,
color
)
{
...
...
cell/model/autofilters.js
View file @
7be9c66d
...
...
@@ -606,21 +606,19 @@
return
{
minChangeRow
:
minChangeRow
,
rangeOldFilter
:
rangeOldFilter
};
},
reapplyAutoFilter
:
function
(
table
Name
,
ar
)
reapplyAutoFilter
:
function
(
display
Name
,
ar
)
{
var
worksheet
=
this
.
worksheet
;
var
bUndoChanges
=
worksheet
.
workbook
.
bUndoChanges
;
var
bRedoChanges
=
worksheet
.
workbook
.
bRedoChanges
;
var
minChangeRow
;
//**get filter**
var
filter
=
this
.
_getFilterByDisplayName
(
displayName
);
var
autoFilter
=
filter
&&
filter
.
getType
()
===
g_nFiltersType
.
tablePart
?
filter
.
AutoFilter
:
filter
;
var
colId
=
this
.
_getColIdColumnByRange
(
filter
,
ar
);
var
index
=
this
.
_getIndexByColId
(
autoFilter
,
colId
);
if
(
filterObj
.
filter
===
null
)
return
;
if
(
filter
===
null
)
return
false
;
History
.
Create_NewPoint
();
History
.
StartTransaction
();
...
...
@@ -630,55 +628,34 @@
{
var
hiddenObj
=
{
start
:
filter
.
Ref
.
r1
+
1
,
h
:
null
};
//TODO скрытие оптимизировать аналогично функции applyAutoFilter
var
startRow
=
autoFilter
&&
autoFilter
.
Ref
?
autoFilter
.
Ref
.
r1
+
1
:
filter
.
Ref
.
r1
+
1
;
var
endRow
=
autoFilter
&&
autoFilter
.
Ref
?
autoFilter
.
Ref
.
r2
:
filter
.
Ref
.
r2
;
for
(
var
i
=
startRow
;
i
<=
endRow
;
i
++
)
{
var
isHidden
=
false
;
if
(
autoFilter
.
FilterColumns
&&
autoFilter
.
FilterColumns
.
length
)
isHidden
=
this
.
_hiddenAnotherFilter
(
autoFilter
.
FilterColumns
,
colId
,
i
,
autoFilter
.
Ref
.
c1
);
isHidden
=
this
.
_hiddenAnotherFilter
(
autoFilter
.
FilterColumns
,
null
,
i
,
autoFilter
.
Ref
.
c1
);
if
(
!
isHidden
)
{
var
cell
=
worksheet
.
getCell3
(
i
,
colId
+
autoFilter
.
Ref
.
c1
);
var
isDateTimeFormat
=
cell
.
getNumFormat
().
isDateTimeFormat
();
var
currentValue
=
isDateTimeFormat
?
cell
.
getValueWithoutFormat
()
:
cell
.
getValueWithFormat
();
var
isSetHidden
=
newFilterColumn
.
isHideValue
(
currentValue
,
isDateTimeFormat
,
null
,
cell
);
if
(
isSetHidden
!==
worksheet
.
getRowHidden
(
i
)
&&
minChangeRow
===
null
)
minChangeRow
=
i
;
//скрываем строки
if
(
hiddenObj
.
h
===
null
)
{
hiddenObj
.
h
=
isSetHidden
;
hiddenObj
.
start
=
i
;
}
else
if
(
hiddenObj
.
h
!==
isSetHidden
)
{
worksheet
.
setRowHidden
(
hiddenObj
.
h
,
hiddenObj
.
start
,
i
-
1
);
hiddenObj
.
h
=
isSetHidden
;
hiddenObj
.
start
=
i
;
}
if
(
i
===
endRow
)
if
(
isHidden
!==
worksheet
.
getRowHidden
(
i
))
{
if
(
minChangeRow
===
null
)
{
worksheet
.
setRowHidden
(
hiddenObj
.
h
,
hiddenObj
.
start
,
i
)
;
minChangeRow
=
i
;
}
}
else
if
(
hiddenObj
.
h
!==
null
)
if
(
true
===
isHidden
)
{
worksheet
.
setRowHidden
(
hiddenObj
.
h
,
hiddenObj
.
start
,
i
-
1
);
hiddenObj
.
h
=
null
worksheet
.
setRowHidden
(
isHidden
,
i
,
i
);
}
}
}
this
.
_resetTablePartStyle
();
History
.
EndTransaction
();
return
{
minChangeRow
:
minChangeRow
,
updateRange
:
filter
.
Ref
};
},
checkRemoveTableParts
:
function
(
delRange
,
tableRange
)
...
...
cell/view/WorksheetView.js
View file @
7be9c66d
...
...
@@ -12017,11 +12017,13 @@
return
;
}
t
.
model
.
autoFilters
.
reapplyAutoFilter
(
tableName
,
ar
);
if
(
null
!==
rangeOldFilter
&&
!
t
.
model
.
workbook
.
bUndoChanges
&&
!
t
.
model
.
workbook
.
bRedoChanges
)
var
applyFilterProps
=
t
.
model
.
autoFilters
.
reapplyAutoFilter
(
tableName
,
ar
);
var
rowChange
=
applyFilterProps
.
rowChange
;
var
updateRange
=
applyFilterProps
.
updateRange
;
if
(
updateRange
&&
!
t
.
model
.
workbook
.
bUndoChanges
&&
!
t
.
model
.
workbook
.
bRedoChanges
)
{
t
.
_onUpdateFormatTable
(
rangeOldFilter
,
false
,
true
);
t
.
_onUpdateFormatTable
(
updateRange
,
false
,
true
);
}
if
(
null
!==
rowChange
)
{
...
...
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