[SSE] Data tab: add sort up button
This commit is contained in:
parent
68d2d406e0
commit
31f2252617
|
@ -315,7 +315,6 @@ define([
|
||||||
toolbar.btnInsertText.on('click', _.bind(this.onBtnInsertTextClick, this));
|
toolbar.btnInsertText.on('click', _.bind(this.onBtnInsertTextClick, this));
|
||||||
toolbar.btnInsertShape.menu.on('hide:after', _.bind(this.onInsertShapeHide, this));
|
toolbar.btnInsertShape.menu.on('hide:after', _.bind(this.onInsertShapeHide, this));
|
||||||
toolbar.btnInsertEquation.on('click', _.bind(this.onInsertEquationClick, this));
|
toolbar.btnInsertEquation.on('click', _.bind(this.onInsertEquationClick, this));
|
||||||
toolbar.btnSortUp.on('click', _.bind(this.onSortType, this, Asc.c_oAscSortOptions.Descending));
|
|
||||||
toolbar.btnSetAutofilter.on('click', _.bind(this.onAutoFilter, this));
|
toolbar.btnSetAutofilter.on('click', _.bind(this.onAutoFilter, this));
|
||||||
toolbar.btnClearAutofilter.on('click', _.bind(this.onClearFilter, this));
|
toolbar.btnClearAutofilter.on('click', _.bind(this.onClearFilter, this));
|
||||||
toolbar.btnTableTemplate.menu.on('show:after', _.bind(this.onTableTplMenuOpen, this));
|
toolbar.btnTableTemplate.menu.on('show:after', _.bind(this.onTableTplMenuOpen, this));
|
||||||
|
@ -2194,7 +2193,7 @@ define([
|
||||||
}
|
}
|
||||||
need_disable = this._state.controlsdisabled.filters || (val===null);
|
need_disable = this._state.controlsdisabled.filters || (val===null);
|
||||||
toolbar.lockToolbar(SSE.enumLock.ruleFilter, need_disable,
|
toolbar.lockToolbar(SSE.enumLock.ruleFilter, need_disable,
|
||||||
{ array: [toolbar.btnSortUp, toolbar.btnTableTemplate,toolbar.btnSetAutofilter].concat(toolbar.btnsSortDown) });
|
{ array: [toolbar.btnTableTemplate,toolbar.btnSetAutofilter].concat(toolbar.btnsSortDown).concat(toolbar.btnsSortUp) });
|
||||||
|
|
||||||
val = (formatTableInfo) ? formatTableInfo.asc_getTableStyleName() : null;
|
val = (formatTableInfo) ? formatTableInfo.asc_getTableStyleName() : null;
|
||||||
if (this._state.tablestylename !== val && this.toolbar.mnuTableTemplatePicker) {
|
if (this._state.tablestylename !== val && this.toolbar.mnuTableTemplatePicker) {
|
||||||
|
@ -2224,11 +2223,11 @@ define([
|
||||||
toolbar.lockToolbar(SSE.enumLock.multiselect, this._state.multiselect, { array: [toolbar.btnTableTemplate, toolbar.btnInsertHyperlink]});
|
toolbar.lockToolbar(SSE.enumLock.multiselect, this._state.multiselect, { array: [toolbar.btnTableTemplate, toolbar.btnInsertHyperlink]});
|
||||||
|
|
||||||
this._state.inpivot = !!info.asc_getPivotTableInfo();
|
this._state.inpivot = !!info.asc_getPivotTableInfo();
|
||||||
toolbar.lockToolbar(SSE.enumLock.editPivot, this._state.inpivot, { array: [toolbar.btnMerge, toolbar.btnInsertHyperlink, toolbar.btnSetAutofilter, toolbar.btnClearAutofilter, toolbar.btnSortUp].concat(toolbar.btnsSortDown)});
|
toolbar.lockToolbar(SSE.enumLock.editPivot, this._state.inpivot, { array: [toolbar.btnMerge, toolbar.btnInsertHyperlink, toolbar.btnSetAutofilter, toolbar.btnClearAutofilter].concat(toolbar.btnsSortDown).concat(toolbar.btnsSortUp)});
|
||||||
|
|
||||||
need_disable = !this.appConfig.canModifyFilter;
|
need_disable = !this.appConfig.canModifyFilter;
|
||||||
toolbar.lockToolbar(SSE.enumLock.cantModifyFilter, need_disable, { array: [toolbar.btnSortUp, toolbar.btnSetAutofilter,
|
toolbar.lockToolbar(SSE.enumLock.cantModifyFilter, need_disable, { array: [toolbar.btnSetAutofilter,
|
||||||
toolbar.btnTableTemplate, toolbar.btnClearStyle.menu.items[0], toolbar.btnClearStyle.menu.items[2] ].concat(toolbar.btnsSortDown)});
|
toolbar.btnTableTemplate, toolbar.btnClearStyle.menu.items[0], toolbar.btnClearStyle.menu.items[2] ].concat(toolbar.btnsSortDown).concat(toolbar.btnsSortUp)});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2424,7 +2423,7 @@ define([
|
||||||
|
|
||||||
need_disable = this._state.controlsdisabled.filters || (val===null);
|
need_disable = this._state.controlsdisabled.filters || (val===null);
|
||||||
me.toolbar.lockToolbar(SSE.enumLock.ruleFilter, need_disable,
|
me.toolbar.lockToolbar(SSE.enumLock.ruleFilter, need_disable,
|
||||||
{ array: [me.toolbar.btnSortUp, me.toolbar.btnSetAutofilter].concat(me.toolbar.btnsSortDown) });
|
{ array: [me.toolbar.btnSetAutofilter].concat(me.toolbar.btnsSortDown).concat(me.toolbar.btnsSortUp) });
|
||||||
|
|
||||||
need_disable = this._state.controlsdisabled.filters || !filterInfo || (filterInfo.asc_getIsApplyAutoFilter()!==true);
|
need_disable = this._state.controlsdisabled.filters || !filterInfo || (filterInfo.asc_getIsApplyAutoFilter()!==true);
|
||||||
me.toolbar.lockToolbar(SSE.enumLock.ruleDelFilter, need_disable, {array:[me.toolbar.btnClearAutofilter]});
|
me.toolbar.lockToolbar(SSE.enumLock.ruleDelFilter, need_disable, {array:[me.toolbar.btnClearAutofilter]});
|
||||||
|
@ -3100,6 +3099,7 @@ define([
|
||||||
datatab = datatab.getView('DataTab');
|
datatab = datatab.getView('DataTab');
|
||||||
Array.prototype.push.apply(me.toolbar.lockControls, datatab.getButtons());
|
Array.prototype.push.apply(me.toolbar.lockControls, datatab.getButtons());
|
||||||
me.toolbar.btnsSortDown = datatab.getButtons('sort-down');
|
me.toolbar.btnsSortDown = datatab.getButtons('sort-down');
|
||||||
|
me.toolbar.btnsSortUp = datatab.getButtons('sort-up');
|
||||||
|
|
||||||
if ( !config.isOffline ) {
|
if ( !config.isOffline ) {
|
||||||
tab = {action: 'pivot', caption: me.textPivot};
|
tab = {action: 'pivot', caption: me.textPivot};
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
<div class="group">
|
<div class="group">
|
||||||
<div class="elset">
|
<div class="elset">
|
||||||
<span class="btn-slot split slot-sortdesc"></span>
|
<span class="btn-slot split slot-sortdesc"></span>
|
||||||
<span class="btn-slot" id="slot-btn-sortasc"></span>
|
<span class="btn-slot slot-sortasc"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="elset">
|
<div class="elset">
|
||||||
<span class="btn-slot split" id="slot-btn-setfilter"></span>
|
<span class="btn-slot split" id="slot-btn-setfilter"></span>
|
||||||
|
@ -155,7 +155,8 @@
|
||||||
<section class="panel" data-tab="data">
|
<section class="panel" data-tab="data">
|
||||||
<div class="group">
|
<div class="group">
|
||||||
<div class="elset">
|
<div class="elset">
|
||||||
<span class="btn-slot slot-sortdesc"></span>
|
<span class="btn-slot split slot-sortdesc"></span>
|
||||||
|
<span class="btn-slot slot-sortasc"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="elset">
|
<div class="elset">
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -71,6 +71,11 @@ define([
|
||||||
me.fireEvent('data:sort', [Asc.c_oAscSortOptions.Ascending]);
|
me.fireEvent('data:sort', [Asc.c_oAscSortOptions.Ascending]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
me.btnsSortUp.forEach(function(button) {
|
||||||
|
button.on('click', function (b, e) {
|
||||||
|
me.fireEvent('data:sort', [Asc.c_oAscSortOptions.Descending]);
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -82,6 +87,7 @@ define([
|
||||||
|
|
||||||
this.lockedControls = [];
|
this.lockedControls = [];
|
||||||
this.btnsSortDown = [];
|
this.btnsSortDown = [];
|
||||||
|
this.btnsSortUp = [];
|
||||||
|
|
||||||
var me = this,
|
var me = this,
|
||||||
$host = me.toolbar.$el,
|
$host = me.toolbar.$el,
|
||||||
|
@ -169,9 +175,13 @@ define([
|
||||||
this.lockedControls.push(this.btnHide);
|
this.lockedControls.push(this.btnHide);
|
||||||
|
|
||||||
_injectComponents($host.find('.slot-sortdesc'), 'btn-sort-down', false, false, '',
|
_injectComponents($host.find('.slot-sortdesc'), 'btn-sort-down', false, false, '',
|
||||||
[_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot],
|
[_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot, _set.cantModifyFilter],
|
||||||
this.btnsSortDown);
|
this.btnsSortDown);
|
||||||
|
|
||||||
|
_injectComponents($host.find('.slot-sortasc'), 'btn-sort-up', false, false, '',
|
||||||
|
[_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot, _set.cantModifyFilter],
|
||||||
|
this.btnsSortUp);
|
||||||
|
|
||||||
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -200,6 +210,9 @@ define([
|
||||||
me.btnsSortDown.forEach( function(btn) {
|
me.btnsSortDown.forEach( function(btn) {
|
||||||
btn.updateHint(me.toolbar.txtSortAZ);
|
btn.updateHint(me.toolbar.txtSortAZ);
|
||||||
});
|
});
|
||||||
|
me.btnsSortUp.forEach( function(btn) {
|
||||||
|
btn.updateHint(me.toolbar.txtSortZA);
|
||||||
|
});
|
||||||
|
|
||||||
setEvents.call(me);
|
setEvents.call(me);
|
||||||
});
|
});
|
||||||
|
@ -213,6 +226,8 @@ define([
|
||||||
getButtons: function(type) {
|
getButtons: function(type) {
|
||||||
if (type == 'sort-down')
|
if (type == 'sort-down')
|
||||||
return this.btnsSortDown;
|
return this.btnsSortDown;
|
||||||
|
else if (type == 'sort-up')
|
||||||
|
return this.btnsSortUp;
|
||||||
else if (type===undefined)
|
else if (type===undefined)
|
||||||
return this.lockedControls;
|
return this.lockedControls;
|
||||||
return [];
|
return [];
|
||||||
|
|
|
@ -716,13 +716,6 @@ define([
|
||||||
menu : new Common.UI.Menu({cls: 'menu-shapes'})
|
menu : new Common.UI.Menu({cls: 'menu-shapes'})
|
||||||
});
|
});
|
||||||
|
|
||||||
me.btnSortUp = new Common.UI.Button({
|
|
||||||
id : 'id-toolbar-btn-sort-up',
|
|
||||||
cls : 'btn-toolbar',
|
|
||||||
iconCls : 'btn-sort-up',
|
|
||||||
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot, _set.cantModifyFilter]
|
|
||||||
});
|
|
||||||
|
|
||||||
me.btnSetAutofilter = new Common.UI.Button({
|
me.btnSetAutofilter = new Common.UI.Button({
|
||||||
id : 'id-toolbar-btn-setautofilter',
|
id : 'id-toolbar-btn-setautofilter',
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
|
|
Loading…
Reference in a new issue