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
82e077f0
Commit
82e077f0
authored
May 11, 2016
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SSE] Добавлен диалог настройки фильтра Top10.
parent
a8e02474
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
185 additions
and
2 deletions
+185
-2
apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js
apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js
+183
-0
apps/spreadsheeteditor/main/resources/less/filterdialog.less
apps/spreadsheeteditor/main/resources/less/filterdialog.less
+2
-2
No files found.
apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js
View file @
82e077f0
...
...
@@ -292,6 +292,180 @@ define([
},
SSE
.
Views
.
DigitalFilterDialog
||
{}));
SSE
.
Views
.
Top10FilterDialog
=
Common
.
UI
.
Window
.
extend
(
_
.
extend
({
initialize
:
function
(
options
)
{
var
t
=
this
,
_options
=
{};
_
.
extend
(
_options
,
{
width
:
318
,
height
:
160
,
contentWidth
:
180
,
header
:
true
,
cls
:
'
filter-dlg
'
,
contentTemplate
:
''
,
title
:
t
.
txtTitle
,
items
:
[]
},
options
);
this
.
template
=
options
.
template
||
[
'
<div class="box" style="height:
'
+
(
_options
.
height
-
85
)
+
'
px;">
'
,
'
<div class="content-panel" >
'
,
'
<div style="margin-right:15px; display: inline-block; vertical-align: middle;">
'
,
'
<label class="input-label">
'
,
t
.
textType
,
'
</label>
'
,
'
<div id="id-top10-type-combo" style=""></div>
'
,
'
</div>
'
,
'
<div style="margin-right:15px; display: inline-block; vertical-align: middle;">
'
,
'
<label class="input-label">
'
,
t
.
textCount
,
'
</label>
'
,
'
<div id="id-top10-count-spin" class="input-group-nr" style=""></div>
'
,
'
</div>
'
,
'
<div style="display: inline-block; vertical-align: middle;">
'
,
'
<label class="input-label">
'
,
t
.
textItem
,
'
</label>
'
,
'
<div id="id-top10-item-combo" class="input-group-nr" style=""></div>
'
,
'
</div>
'
,
'
</div>
'
,
'
</div>
'
,
'
<div class="separator horizontal" style="width:100%"></div>
'
,
'
<div class="footer center">
'
,
'
<button class="btn normal dlg-btn primary" result="ok" style="margin-right:10px;">
'
,
t
.
okButtonText
,
'
</button>
'
,
'
<button class="btn normal dlg-btn" result="cancel">
'
,
t
.
cancelButtonText
,
'
</button>
'
,
'
</div>
'
].
join
(
''
);
this
.
api
=
options
.
api
;
this
.
handler
=
options
.
handler
;
_options
.
tpl
=
_
.
template
(
this
.
template
,
_options
);
Common
.
UI
.
Window
.
prototype
.
initialize
.
call
(
this
,
_options
);
},
render
:
function
()
{
Common
.
UI
.
Window
.
prototype
.
render
.
call
(
this
);
this
.
cmbType
=
new
Common
.
UI
.
ComboBox
({
el
:
$
(
'
#id-top10-type-combo
'
,
this
.
$window
),
style
:
'
width: 85px;
'
,
menuStyle
:
'
min-width: 85px;
'
,
cls
:
'
input-group-nr
'
,
data
:
[
{
value
:
true
,
displayValue
:
this
.
txtTop
},
{
value
:
false
,
displayValue
:
this
.
txtBottom
}
],
editable
:
false
});
this
.
cmbType
.
setValue
(
true
);
this
.
cmbItem
=
new
Common
.
UI
.
ComboBox
({
el
:
$
(
'
#id-top10-item-combo
'
,
this
.
$window
),
style
:
'
width: 85px;
'
,
menuStyle
:
'
min-width: 85px;
'
,
cls
:
'
input-group-nr
'
,
data
:
[
{
value
:
false
,
displayValue
:
this
.
txtItems
},
{
value
:
true
,
displayValue
:
this
.
txtPercent
}
],
editable
:
false
});
this
.
cmbItem
.
setValue
(
false
);
this
.
cmbItem
.
on
(
'
selected
'
,
_
.
bind
(
function
(
combo
,
record
)
{
this
.
spnCount
.
setDefaultUnit
(
record
.
value
?
'
%
'
:
''
);
},
this
));
this
.
spnCount
=
new
Common
.
UI
.
MetricSpinner
({
el
:
$
(
'
#id-top10-count-spin
'
),
step
:
1
,
width
:
85
,
defaultUnit
:
""
,
value
:
'
10
'
,
maxValue
:
500
,
minValue
:
1
});
this
.
$window
.
find
(
'
.dlg-btn
'
).
on
(
'
click
'
,
_
.
bind
(
this
.
onBtnClick
,
this
));
this
.
loadDefaults
();
},
show
:
function
()
{
Common
.
UI
.
Window
.
prototype
.
show
.
call
(
this
);
var
me
=
this
;
_
.
defer
(
function
()
{
if
(
me
.
txtValue1
)
{
me
.
txtValue1
.
focus
();
}
},
500
);
},
close
:
function
()
{
if
(
this
.
api
)
{
this
.
api
.
asc_enableKeyEvents
(
true
);
}
Common
.
UI
.
Window
.
prototype
.
close
.
call
(
this
);
},
onBtnClick
:
function
(
event
)
{
if
(
event
.
currentTarget
.
attributes
&&
event
.
currentTarget
.
attributes
.
result
)
{
if
(
'
ok
'
===
event
.
currentTarget
.
attributes
.
result
.
value
)
{
this
.
save
();
}
this
.
close
();
}
},
setSettings
:
function
(
properties
)
{
this
.
properties
=
properties
;
},
loadDefaults
:
function
()
{
if
(
this
.
properties
)
{
var
filterObj
=
this
.
properties
.
asc_getFilterObj
();
if
(
filterObj
.
asc_getType
()
==
Asc
.
c_oAscAutoFilterTypes
.
Top10
)
{
var
top10Filter
=
filterObj
.
asc_getFilter
(),
type
=
top10Filter
.
asc_getTop
(),
percent
=
top10Filter
.
asc_getPercent
();
this
.
cmbType
.
setValue
(
type
||
type
===
null
);
this
.
cmbItem
.
setValue
(
percent
||
percent
===
null
);
this
.
spnCount
.
setValue
(
top10Filter
.
asc_setVal
());
}
}
},
save
:
function
()
{
if
(
this
.
api
&&
this
.
properties
)
{
var
filterObj
=
this
.
properties
.
asc_getFilterObj
();
filterObj
.
asc_setFilter
(
new
Asc
.
Top10
());
filterObj
.
asc_setType
(
Asc
.
c_oAscAutoFilterTypes
.
Top10
);
var
top10Filter
=
filterObj
.
asc_getFilter
();
top10Filter
.
asc_setTop
(
this
.
cmbType
.
getValue
());
top10Filter
.
asc_setPercent
(
this
.
cmbItem
.
getValue
());
top10Filter
.
asc_setVal
(
this
.
spnCount
.
getNumberValue
());
this
.
api
.
asc_applyAutoFilter
(
this
.
properties
);
}
},
onPrimary
:
function
()
{
this
.
save
();
this
.
close
();
return
false
;
},
cancelButtonText
:
"
Cancel
"
,
okButtonText
:
'
OK
'
,
txtTitle
:
"
Top 10 Filter
"
,
textType
:
'
Show
'
,
textCount
:
''
,
textItem
:
''
,
txtTop
:
'
Top
'
,
txtBottom
:
'
Bottom
'
,
txtItems
:
'
Item
'
,
txtPercent
:
'
Percent
'
},
SSE
.
Views
.
Top10FilterDialog
||
{}));
SSE
.
Views
.
AutoFilterDialog
=
Common
.
UI
.
Window
.
extend
(
_
.
extend
({
initialize
:
function
(
options
)
{
...
...
@@ -746,7 +920,16 @@ define([
},
onTop10FilterItemClick
:
function
(
menu
,
item
)
{
var
me
=
this
,
dlgTop10Filter
=
new
SSE
.
Views
.
Top10FilterDialog
({
api
:
this
.
api
}).
on
({
'
close
'
:
function
()
{
me
.
close
();
}
});
this
.
close
();
dlgTop10Filter
.
setSettings
(
this
.
configTo
);
dlgTop10Filter
.
show
();
},
onFilterColorSelect
:
function
(
isCellColor
,
picker
,
color
)
{
...
...
apps/spreadsheeteditor/main/resources/less/filterdialog.less
View file @
82e077f0
...
...
@@ -2,7 +2,7 @@
.combo-values {
width: 100%;
height: 16
0
px;
height: 16
2
px;
overflow: hidden;
.list-item {
...
...
@@ -87,7 +87,7 @@
}
.footer {
padding-top: 1
7
px;
padding-top: 1
5
px;
&.center {
text-align: center;
...
...
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