diff --git a/apps/spreadsheeteditor/main/app/controller/PivotTable.js b/apps/spreadsheeteditor/main/app/controller/PivotTable.js index d295b33f3..b59919c80 100644 --- a/apps/spreadsheeteditor/main/app/controller/PivotTable.js +++ b/apps/spreadsheeteditor/main/app/controller/PivotTable.js @@ -66,6 +66,9 @@ define([ 'pivottable:blankrows': _.bind(this.onPivotBlankRows, this), 'pivottable:subtotals': _.bind(this.onPivotSubtotals, this), 'pivottable:grandtotals': _.bind(this.onPivotGrandTotals, this) + }, + 'TableSettings': { + 'pivottable:create': _.bind(this.onCreateClick, this) } }); }, diff --git a/apps/spreadsheeteditor/main/app/template/TableSettings.template b/apps/spreadsheeteditor/main/app/template/TableSettings.template index 5f980d0ce..78e589aa3 100644 --- a/apps/spreadsheeteditor/main/app/template/TableSettings.template +++ b/apps/spreadsheeteditor/main/app/template/TableSettings.template @@ -88,6 +88,11 @@ + + + + +
diff --git a/apps/spreadsheeteditor/main/app/view/RightMenu.js b/apps/spreadsheeteditor/main/app/view/RightMenu.js index a2f6f68bb..c38ecd3f1 100644 --- a/apps/spreadsheeteditor/main/app/view/RightMenu.js +++ b/apps/spreadsheeteditor/main/app/view/RightMenu.js @@ -266,6 +266,7 @@ define([ this.mode = mode; this.imageSettings && this.imageSettings.setMode(mode); this.shapeSettings && this.shapeSettings.setMode(mode); + this.tableSettings && this.tableSettings.setMode(mode); return this; }, diff --git a/apps/spreadsheeteditor/main/app/view/TableSettings.js b/apps/spreadsheeteditor/main/app/view/TableSettings.js index 43dc418e4..563607dff 100644 --- a/apps/spreadsheeteditor/main/app/view/TableSettings.js +++ b/apps/spreadsheeteditor/main/app/view/TableSettings.js @@ -184,6 +184,10 @@ define([ return this; }, + setMode: function(mode) { + this.mode = mode; + }, + createDelayedControls: function() { var me = this; this.chHeader = new Common.UI.CheckBox({ @@ -312,6 +316,14 @@ define([ this.btnSlicer.on('click', _.bind(this.onInsertSlicerClick, this)); this.lockedControls.push(this.btnSlicer); + this.btnPivot = new Common.UI.Button({ + el: $('#table-btn-pivot') + }); + this.btnPivot.on('click', _.bind(this.onInsertPivotClick, this)); + this.lockedControls.push(this.btnPivot); + + this.$el.find('.pivot-only').toggleClass('hidden', !this.mode.canFeaturePivot); + $(this.el).on('click', '#table-advanced-link', _.bind(this.openAdvancedSettings, this)); this._initSettings = false; @@ -551,6 +563,10 @@ define([ } }, + onInsertPivotClick: function() { + this.fireEvent('pivottable:create'); + }, + onApiEditCell: function(state) { this.isEditCell = (state != Asc.c_oAscCellEditorState.editEnd); if ( state == Asc.c_oAscCellEditorState.editStart || state == Asc.c_oAscCellEditorState.editEnd) @@ -609,7 +625,8 @@ define([ textLongOperation: 'Long operation', warnLongOperation: 'The operation you are about to perform might take rather much time to complete.
Are you sure you want to continue?', textRemDuplicates: 'Remove duplicates', - textSlicer: 'Insert slicer' - + textSlicer: 'Insert slicer', + textPivot: 'Insert pivot table' + }, SSE.Views.TableSettings || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 2b044c92f..989028ff4 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -2479,6 +2479,7 @@ "SSE.Views.TableSettings.textTotal": "Total", "SSE.Views.TableSettings.warnLongOperation": "The operation you are about to perform might take rather much time to complete.
Are you sure you want to continue?", "SSE.Views.TableSettings.textSlicer": "Insert slicer", + "SSE.Views.TableSettings.textPivot": "Insert pivot table", "SSE.Views.TableSettingsAdvanced.textAlt": "Alternative Text", "SSE.Views.TableSettingsAdvanced.textAltDescription": "Description", "SSE.Views.TableSettingsAdvanced.textAltTip": "The alternative text-based representation of the visual object information, which will be read to the people with vision or cognitive impairments to help them better understand what information there is in the image, autoshape, chart or table.",