Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
web-apps
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
web-apps
Commits
3de94942
Commit
3de94942
authored
May 05, 2016
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SSE] Применение сортировки и фильтрации по цвету.
parent
514f3d37
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
46 deletions
+64
-46
apps/spreadsheeteditor/main/app/controller/Toolbar.js
apps/spreadsheeteditor/main/app/controller/Toolbar.js
+4
-4
apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js
apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js
+56
-38
apps/spreadsheeteditor/main/app/view/DocumentHolder.js
apps/spreadsheeteditor/main/app/view/DocumentHolder.js
+2
-2
apps/spreadsheeteditor/main/app/view/Toolbar.js
apps/spreadsheeteditor/main/app/view/Toolbar.js
+2
-2
No files found.
apps/spreadsheeteditor/main/app/controller/Toolbar.js
View file @
3de94942
...
...
@@ -206,10 +206,10 @@ define([
toolbar
.
btnInsertText
.
on
(
'
click
'
,
_
.
bind
(
this
.
onBtnInsertTextClick
,
this
));
toolbar
.
btnInsertText
.
menu
.
on
(
'
item:click
'
,
_
.
bind
(
this
.
onInsertTextClick
,
this
));
toolbar
.
btnInsertShape
.
menu
.
on
(
'
hide:after
'
,
_
.
bind
(
this
.
onInsertShapeHide
,
this
));
toolbar
.
btnSortDown
.
on
(
'
click
'
,
_
.
bind
(
this
.
onSortType
,
this
,
'
ascending
'
));
toolbar
.
btnSortUp
.
on
(
'
click
'
,
_
.
bind
(
this
.
onSortType
,
this
,
'
descending
'
));
toolbar
.
mnuitemSortAZ
.
on
(
'
click
'
,
_
.
bind
(
this
.
onSortType
,
this
,
'
ascending
'
));
toolbar
.
mnuitemSortZA
.
on
(
'
click
'
,
_
.
bind
(
this
.
onSortType
,
this
,
'
descending
'
));
toolbar
.
btnSortDown
.
on
(
'
click
'
,
_
.
bind
(
this
.
onSortType
,
this
,
Asc
.
c_oAscSortOptions
.
Ascending
));
toolbar
.
btnSortUp
.
on
(
'
click
'
,
_
.
bind
(
this
.
onSortType
,
this
,
Asc
.
c_oAscSortOptions
.
Descending
));
toolbar
.
mnuitemSortAZ
.
on
(
'
click
'
,
_
.
bind
(
this
.
onSortType
,
this
,
Asc
.
c_oAscSortOptions
.
Ascending
));
toolbar
.
mnuitemSortZA
.
on
(
'
click
'
,
_
.
bind
(
this
.
onSortType
,
this
,
Asc
.
c_oAscSortOptions
.
Descending
));
toolbar
.
btnSetAutofilter
.
on
(
'
click
'
,
_
.
bind
(
this
.
onAutoFilter
,
this
));
toolbar
.
mnuitemAutoFilter
.
on
(
'
click
'
,
_
.
bind
(
this
.
onAutoFilter
,
this
));
toolbar
.
btnClearAutofilter
.
on
(
'
click
'
,
_
.
bind
(
this
.
onClearFilter
,
this
));
...
...
apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js
View file @
3de94942
...
...
@@ -365,7 +365,7 @@ define([
checkable
:
true
,
checked
:
false
});
this
.
miSortLow2High
.
on
(
'
click
'
,
_
.
bind
(
this
.
onSortType
,
this
,
'
ascending
'
));
this
.
miSortLow2High
.
on
(
'
click
'
,
_
.
bind
(
this
.
onSortType
,
this
,
Asc
.
c_oAscSortOptions
.
Ascending
));
this
.
miSortHigh2Low
=
new
Common
.
UI
.
MenuItem
({
caption
:
this
.
txtSortHigh2Low
,
...
...
@@ -373,7 +373,7 @@ define([
checkable
:
true
,
checked
:
false
});
this
.
miSortHigh2Low
.
on
(
'
click
'
,
_
.
bind
(
this
.
onSortType
,
this
,
'
descending
'
));
this
.
miSortHigh2Low
.
on
(
'
click
'
,
_
.
bind
(
this
.
onSortType
,
this
,
Asc
.
c_oAscSortOptions
.
Descending
));
this
.
miSortCellColor
=
new
Common
.
UI
.
MenuItem
({
caption
:
this
.
txtSortCellColor
,
...
...
@@ -483,10 +483,13 @@ define([
caption
:
this
.
txtClear
,
checkable
:
false
});
this
.
miClear
.
on
(
'
click
'
,
_
.
bind
(
this
.
onClear
,
this
));
this
.
miReapply
=
new
Common
.
UI
.
MenuItem
({
caption
:
this
.
txtReapply
,
checkable
:
false
});
this
.
miReapply
.
on
(
'
click
'
,
_
.
bind
(
this
.
onReapply
,
this
));
this
.
filtersMenu
=
new
Common
.
UI
.
Menu
({
items
:
[
...
...
@@ -519,7 +522,7 @@ define([
'
006400
'
,
'
800080
'
,
'
8B0000
'
,
'
808000
'
,
'
FFFFFF
'
,
'
D3D3D3
'
]
});
this
.
mnuSortColorCellsPicker
.
on
(
'
select
'
,
_
.
bind
(
this
.
onSortColor
CellsSelect
,
this
));
this
.
mnuSortColorCellsPicker
.
on
(
'
select
'
,
_
.
bind
(
this
.
onSortColor
Select
,
this
,
Asc
.
c_oAscSortOptions
.
ByColorFill
));
this
.
mnuSortColorFontPicker
=
new
Common
.
UI
.
ColorPaletteExt
({
el
:
$
(
'
#filter-dlg-sort-font-color
'
),
...
...
@@ -530,7 +533,7 @@ define([
'
006400
'
,
'
800080
'
,
'
8B0000
'
,
'
808000
'
,
'
FFFFFF
'
,
'
D3D3D3
'
]
});
this
.
mnuSortColorFontPicker
.
on
(
'
select
'
,
_
.
bind
(
this
.
onSortColor
FontSelect
,
this
));
this
.
mnuSortColorFontPicker
.
on
(
'
select
'
,
_
.
bind
(
this
.
onSortColor
Select
,
this
,
Asc
.
c_oAscSortOptions
.
ByColorFont
));
this
.
mnuFilterColorCellsPicker
=
new
Common
.
UI
.
ColorPaletteExt
({
el
:
$
(
'
#filter-dlg-filter-cells-color
'
),
...
...
@@ -665,7 +668,7 @@ define([
}
if
(
item
.
value
==
0
)
{
//clear filters
this
.
onClear
();
return
;
}
else
if
(
item
.
value
!==-
1
)
{
var
newCustomFilter
=
new
Asc
.
CustomFilters
();
...
...
@@ -718,7 +721,7 @@ define([
}
if
(
item
.
value
==
0
)
{
//clear filters
this
.
onClear
();
return
;
}
else
if
(
item
.
value
!==-
1
)
{
var
newCustomFilter
=
new
Asc
.
CustomFilters
();
...
...
@@ -762,14 +765,13 @@ define([
this
.
close
();
},
onSortColorCellsSelect
:
function
(
picker
,
color
)
{
onSortColorSelect
:
function
(
type
,
picker
,
color
)
{
if
(
this
.
api
&&
this
.
configTo
)
{
this
.
api
.
asc_sortColFilter
(
type
,
this
.
configTo
.
asc_getCellId
(),
this
.
configTo
.
asc_getDisplayName
(),
color
==
'
transparent
'
?
null
:
Common
.
Utils
.
ThemeColor
.
getRgbColor
(
color
));
}
this
.
close
();
},
onSortColorFontSelect
:
function
(
picker
,
color
)
{
},
onCellCheck
:
function
(
listView
,
itemView
,
record
)
{
if
(
this
.
checkCellTrigerBlock
)
return
;
...
...
@@ -843,6 +845,18 @@ define([
}
},
onClear
:
function
()
{
if
(
this
.
api
&&
this
.
configTo
)
this
.
api
.
asc_clearFilterColumn
(
this
.
configTo
.
asc_getCellId
(),
this
.
configTo
.
asc_getDisplayName
());
this
.
close
();
},
onReapply
:
function
()
{
if
(
this
.
api
&&
this
.
configTo
)
this
.
api
.
asc_applyAutoFilter
(
this
.
config
);
this
.
close
();
},
setSettings
:
function
(
config
)
{
this
.
config
=
config
;
this
.
configTo
=
config
;
...
...
@@ -855,39 +869,52 @@ define([
isCustomFilter
=
(
this
.
initialFilterType
===
Asc
.
c_oAscAutoFilterTypes
.
CustomFilters
),
isTextFilter
=
this
.
configTo
.
asc_getIsTextFilter
(),
colorsFill
=
this
.
configTo
.
asc_getColorsFill
(),
colorsFont
=
this
.
configTo
.
asc_getColorsFont
();
colorsFont
=
this
.
configTo
.
asc_getColorsFont
(),
sort
=
this
.
configTo
.
asc_getSortState
(),
sortColor
=
this
.
configTo
.
asc_getSortColor
();
if
(
sortColor
)
sortColor
=
Common
.
Utils
.
ThemeColor
.
getHexColor
(
sortColor
.
get_r
(),
sortColor
.
get_g
(),
sortColor
.
get_b
()).
toLocaleUpperCase
();
this
.
miTextFilter
.
setVisible
(
isTextFilter
);
this
.
miNumFilter
.
setVisible
(
!
isTextFilter
);
this
.
miTextFilter
.
setChecked
(
isCustomFilter
&&
isTextFilter
,
true
);
this
.
miNumFilter
.
setChecked
(
isCustomFilter
&&
!
isTextFilter
,
true
);
if
(
colorsFont
&&
colorsFont
.
length
>
0
)
{
this
.
miSortLow2High
.
setChecked
(
sort
==
Asc
.
c_oAscSortOptions
.
Ascending
,
true
);
this
.
miSortHigh2Low
.
setChecked
(
sort
==
Asc
.
c_oAscSortOptions
.
Descending
,
true
);
var
hasColors
=
(
colorsFont
&&
colorsFont
.
length
>
0
);
this
.
miSortFontColor
.
setVisible
(
hasColors
);
this
.
miFilterFontColor
.
setVisible
(
hasColors
);
if
(
hasColors
)
{
var
colors
=
[
'
transparent
'
];
colorsFont
.
forEach
(
function
(
item
,
index
)
{
colors
.
push
(
Common
.
Utils
.
ThemeColor
.
getHexColor
(
item
.
get_r
(),
item
.
get_g
(),
item
.
get_b
()).
toLocaleUpperCase
());
});
this
.
mnuSortColorFontPicker
.
updateColors
(
colors
);
this
.
mnuFilterColorFontPicker
.
updateColors
(
colors
);
this
.
miSortFontColor
.
setVisible
(
true
);
this
.
miFilterFontColor
.
set
Visible
(
true
);
}
else
{
this
.
miSortFontColor
.
setVisible
(
false
);
this
.
miFilterFontColor
.
setVisible
(
fals
e
);
this
.
miFilterFontColor
.
set
Checked
(
false
,
true
);
this
.
miSortFontColor
.
setChecked
(
sort
==
Asc
.
c_oAscSortOptions
.
ByColorFont
,
true
);
if
(
sort
==
Asc
.
c_oAscSortOptions
.
ByColorFont
)
this
.
mnuSortColorFontPicker
.
select
(
sortColor
,
tru
e
);
}
if
(
colorsFill
&&
colorsFill
.
length
>
0
)
{
hasColors
=
(
colorsFill
&&
colorsFill
.
length
>
0
);
this
.
miSortCellColor
.
setVisible
(
hasColors
);
this
.
miFilterCellColor
.
setVisible
(
hasColors
);
if
(
hasColors
)
{
var
colors
=
[
'
transparent
'
];
colorsFill
.
forEach
(
function
(
item
,
index
)
{
colors
.
push
(
Common
.
Utils
.
ThemeColor
.
getHexColor
(
item
.
get_r
(),
item
.
get_g
(),
item
.
get_b
()).
toLocaleUpperCase
());
});
this
.
mnuSortColorCellsPicker
.
updateColors
(
colors
);
this
.
mnuFilterColorCellsPicker
.
updateColors
(
colors
);
this
.
miSortCellColor
.
setVisible
(
true
);
this
.
miFilterCellColor
.
set
Visible
(
true
);
}
else
{
this
.
miSortCellColor
.
setVisible
(
false
);
this
.
miFilterCellColor
.
setVisible
(
fals
e
);
this
.
miFilterCellColor
.
set
Checked
(
false
,
true
);
this
.
miSortCellColor
.
setChecked
(
sort
==
Asc
.
c_oAscSortOptions
.
ByColorFill
,
true
);
if
(
sort
==
Asc
.
c_oAscSortOptions
.
ByColorFill
)
this
.
mnuSortColorFontPicker
.
select
(
sortColor
,
tru
e
);
}
if
(
isCustomFilter
)
{
...
...
@@ -916,24 +943,15 @@ define([
filterColor
=
colorFilter
.
asc_getCColor
();
if
(
filterColor
)
filterColor
=
Common
.
Utils
.
ThemeColor
.
getHexColor
(
filterColor
.
get_r
(),
filterColor
.
get_g
(),
filterColor
.
get_b
()).
toLocaleUpperCase
();
if
(
colorFilter
.
asc_getCellColor
()
===
null
)
// cell color
if
(
colorFilter
.
asc_getCellColor
()
===
null
)
{
// cell color
this
.
miFilterCellColor
.
setChecked
(
true
,
true
);
this
.
mnuFilterColorCellsPicker
.
select
(
filterColor
,
true
);
else
if
(
colorFilter
.
asc_getCellColor
()
===
false
)
// font color
}
else
if
(
colorFilter
.
asc_getCellColor
()
===
false
)
{
// font color
this
.
miFilterFontColor
.
setChecked
(
true
,
true
);
this
.
mnuFilterColorFontPicker
.
select
(
filterColor
,
true
);
}
this
.
miSortLow2High
.
setChecked
(
false
,
true
);
this
.
miSortHigh2Low
.
setChecked
(
false
,
true
);
var
sort
=
this
.
configTo
.
asc_getSortState
();
if
(
sort
)
{
if
(
'
ascending
'
===
sort
)
{
this
.
miSortLow2High
.
setChecked
(
true
,
true
);
}
else
{
this
.
miSortHigh2Low
.
setChecked
(
true
,
true
);
}
}
this
.
btnOk
.
setDisabled
(
isCustomFilter
);
},
...
...
apps/spreadsheeteditor/main/app/view/DocumentHolder.js
View file @
3de94942
...
...
@@ -230,10 +230,10 @@ define([
items
:
[
{
caption
:
me
.
txtAscending
,
value
:
'
ascending
'
value
:
Asc
.
c_oAscSortOptions
.
Ascending
},{
caption
:
me
.
txtDescending
,
value
:
'
descending
'
value
:
Asc
.
c_oAscSortOptions
.
Descending
}
]
})
...
...
apps/spreadsheeteditor/main/app/view/Toolbar.js
View file @
3de94942
...
...
@@ -1454,13 +1454,13 @@ define([
caption
:
me
.
txtSortAZ
,
iconCls
:
'
mnu-sort-asc
'
,
lock
:
[
_set
.
selChart
,
_set
.
selChartText
,
_set
.
selShape
,
_set
.
selShapeText
,
_set
.
selImage
,
_set
.
coAuth
,
_set
.
ruleFilter
],
value
:
'
ascending
'
value
:
Asc
.
c_oAscSortOptions
.
Ascending
}),
me
.
mnuitemSortZA
=
new
Common
.
UI
.
MenuItem
({
caption
:
me
.
txtSortZA
,
iconCls
:
'
mnu-sort-desc
'
,
lock
:
[
_set
.
selChart
,
_set
.
selChartText
,
_set
.
selShape
,
_set
.
selShapeText
,
_set
.
selImage
,
_set
.
coAuth
,
_set
.
ruleFilter
],
value
:
'
descending
'
value
:
Asc
.
c_oAscSortOptions
.
Descending
}),
me
.
mnuitemAutoFilter
=
new
Common
.
UI
.
MenuItem
({
caption
:
me
.
txtFilter
,
...
...
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