[SSE] Bug 32599.

This commit is contained in:
Julia Radzhabova 2017-02-06 17:12:59 +03:00
parent e441f92b31
commit ead4d45e61
3 changed files with 64 additions and 7 deletions

View file

@ -338,10 +338,31 @@ define([
onSortCells: function(menu, item) {
if (this.api) {
this.api.asc_sortColFilter(item.value, '', undefined, (item.value==Asc.c_oAscSortOptions.ByColorFill) ? this.documentHolder.ssMenu.cellColor : this.documentHolder.ssMenu.fontColor);
var res = this.api.asc_sortCellsRangeExpand();
if (res) {
var config = {
width: 500,
title: this.txtSorting,
msg: this.txtExpandSort,
iconCls: 'warn',
buttons: [ {caption: this.txtExpand, primary: true, value: 'expand'},
{caption: this.txtSortSelected, primary: true, value: 'sort'},
'cancel'],
callback: _.bind(function(btn){
if (btn == 'expand' || btn == 'sort') {
this.api.asc_sortColFilter(item.value, '', undefined, (item.value==Asc.c_oAscSortOptions.ByColorFill) ? this.documentHolder.ssMenu.cellColor : this.documentHolder.ssMenu.fontColor, btn == 'expand');
}
Common.NotificationCenter.trigger('edit:complete', this.documentHolder);
Common.component.Analytics.trackEvent('DocumentHolder', 'Sort Cells');
}, this)
};
Common.UI.alert(config);
} else {
this.api.asc_sortColFilter(item.value, '', undefined, (item.value==Asc.c_oAscSortOptions.ByColorFill) ? this.documentHolder.ssMenu.cellColor : this.documentHolder.ssMenu.fontColor, res !== null);
Common.NotificationCenter.trigger('edit:complete', this.documentHolder);
Common.component.Analytics.trackEvent('DocumentHolder', 'Sort Cells');
Common.NotificationCenter.trigger('edit:complete', this.documentHolder);
Common.component.Analytics.trackEvent('DocumentHolder', 'Sort Cells');
}
}
},
@ -2299,7 +2320,11 @@ define([
deleteText : 'Delete',
deleteRowText : 'Delete Row',
deleteColumnText : 'Delete Column',
txtNoChoices: 'There are no choices for filling the cell.<br>Only text values from the column can be selected for replacement.'
txtNoChoices: 'There are no choices for filling the cell.<br>Only text values from the column can be selected for replacement.',
txtExpandSort: 'The data next to the selection will not be sorted. Do you want to expand the selection to include the adjacent data or continue with sorting the currently selected cells only?',
txtExpand: 'Expand and sort',
txtSorting: 'Sorting',
txtSortSelected: 'Sort selected'
}, SSE.Controllers.DocumentHolder || {}));
});

View file

@ -839,8 +839,27 @@ define([
},
onSortType: function(type, btn) {
if (this.api)
this.api.asc_sortColFilter(type, '');
if (this.api) {
var res = this.api.asc_sortCellsRangeExpand();
if (res) {
var config = {
width: 500,
title: this.txtSorting,
msg: this.txtExpandSort,
iconCls: 'warn',
buttons: [ {caption: this.txtExpand, primary: true, value: 'expand'},
{caption: this.txtSortSelected, primary: true, value: 'sort'},
'cancel'],
callback: _.bind(function(btn){
if (btn == 'expand' || btn == 'sort') {
this.api.asc_sortColFilter(type, '', undefined, undefined, btn == 'expand');
}
}, this)
};
Common.UI.alert(config);
} else
this.api.asc_sortColFilter(type, '', undefined, undefined, res !== null);
}
},
onSearch: function(type, btn) {
@ -2966,6 +2985,11 @@ define([
txtMatrix_2_2_LineBracket : 'Empty Matrix with Brackets',
txtMatrix_2_2_DLineBracket : 'Empty Matrix with Brackets',
txtMatrix_Flat_Round : 'Sparse Matrix',
txtMatrix_Flat_Square : 'Sparse Matrix'
txtMatrix_Flat_Square : 'Sparse Matrix',
txtExpandSort: 'The data next to the selection will not be sorted. Do you want to expand the selection to include the adjacent data or continue with sorting the currently selected cells only?',
txtExpand: 'Expand and sort',
txtSorting: 'Sorting',
txtSortSelected: 'Sort selected'
}, SSE.Controllers.Toolbar || {}));
});

View file

@ -194,6 +194,10 @@
"SSE.Controllers.DocumentHolder.txtTop": "Top",
"SSE.Controllers.DocumentHolder.txtUnderbar": "Bar under text",
"SSE.Controllers.DocumentHolder.txtWidth": "Width",
"SSE.Controllers.DocumentHolder.txtExpandSort": "The data next to the selection will not be sorted. Do you want to expand the selection to include the adjacent data or continue with sorting the currently selected cells only?",
"SSE.Controllers.DocumentHolder.txtExpand": "Expand and sort",
"SSE.Controllers.DocumentHolder.txtSorting": "Sorting",
"SSE.Controllers.DocumentHolder.txtSortSelected": "Sort selected",
"SSE.Controllers.LeftMenu.newDocumentTitle": "Unnamed spreadsheet",
"SSE.Controllers.LeftMenu.textByColumns": "By columns",
"SSE.Controllers.LeftMenu.textByRows": "By rows",
@ -675,6 +679,10 @@
"SSE.Controllers.Toolbar.txtSymbol_xsi": "Xi",
"SSE.Controllers.Toolbar.txtSymbol_zeta": "Zeta",
"SSE.Controllers.Toolbar.warnMergeLostData": "Only the data from the upper-left cell will remain in the merged cell. <br>Are you sure you want to continue?",
"SSE.Controllers.Toolbar.txtExpandSort": "The data next to the selection will not be sorted. Do you want to expand the selection to include the adjacent data or continue with sorting the currently selected cells only?",
"SSE.Controllers.Toolbar.txtExpand": "Expand and sort",
"SSE.Controllers.Toolbar.txtSorting": "Sorting",
"SSE.Controllers.Toolbar.txtSortSelected": "Sort selected",
"SSE.Views.AutoFilterDialog.btnCustomFilter": "Custom Filter",
"SSE.Views.AutoFilterDialog.cancelButtonText": "Cancel",
"SSE.Views.AutoFilterDialog.okButtonText": "OK",