diff --git a/apps/spreadsheeteditor/main/app/controller/DataTab.js b/apps/spreadsheeteditor/main/app/controller/DataTab.js index bac379324..9a8c5b33e 100644 --- a/apps/spreadsheeteditor/main/app/controller/DataTab.js +++ b/apps/spreadsheeteditor/main/app/controller/DataTab.js @@ -97,6 +97,7 @@ define([ } }); Common.NotificationCenter.on('data:remduplicates', _.bind(this.onRemoveDuplicates, this)); + Common.NotificationCenter.on('data:sortcustom', _.bind(this.onCustomSort, this)); }, SetDisabled: function(state) { diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index f8ac21e70..c5cf1355e 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -407,6 +407,10 @@ define([ }, onSortCells: function(menu, item) { + if (item.value=='advanced') { + Common.NotificationCenter.trigger('data:sortcustom', this); + return; + } if (this.api) { var res = this.api.asc_sortCellsRangeExpand(); if (res) { @@ -1875,6 +1879,7 @@ define([ documentHolder.pmiSortCells.setVisible((iscellmenu||isallmenu) && !iscelledit); documentHolder.pmiSortCells.menu.items[2].setVisible(!internaleditor); documentHolder.pmiSortCells.menu.items[3].setVisible(!internaleditor); + documentHolder.pmiSortCells.menu.items[4].setVisible(!internaleditor); documentHolder.pmiFilterCells.setVisible(iscellmenu && !iscelledit && !internaleditor); documentHolder.pmiReapply.setVisible((iscellmenu||isallmenu) && !iscelledit && !internaleditor); documentHolder.ssMenu.items[12].setVisible((iscellmenu||isallmenu||isinsparkline) && !iscelledit); diff --git a/apps/spreadsheeteditor/main/app/view/DocumentHolder.js b/apps/spreadsheeteditor/main/app/view/DocumentHolder.js index 7e430963e..4e10255dc 100644 --- a/apps/spreadsheeteditor/main/app/view/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/view/DocumentHolder.js @@ -305,6 +305,9 @@ define([ },{ caption : me.txtSortFontColor, value : Asc.c_oAscSortOptions.ByColorFont + },{ + caption : me.txtCustomSort, + value : 'advanced' } ] }) @@ -1210,7 +1213,8 @@ define([ textSum: 'Sum', textStdDev: 'StdDev', textVar: 'Var', - textMore: 'More functions' + textMore: 'More functions', + txtCustomSort: 'Custom sort' }, SSE.Views.DocumentHolder || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index a08935f7a..4431511f6 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1602,6 +1602,7 @@ "SSE.Views.DocumentHolder.textMax": "Max", "SSE.Views.DocumentHolder.textMin": "Min", "SSE.Views.DocumentHolder.textMore": "More functions", + "SSE.Views.DocumentHolder.txtCustomSort": "Custom sort", "SSE.Views.DocumentHolder.textMoreFormats": "More formats", "SSE.Views.DocumentHolder.textNone": "None", "SSE.Views.DocumentHolder.textReplace": "Replace image",