[SSE] Add pivot table from the right panel

This commit is contained in:
Julia Radzhabova 2020-06-22 16:01:05 +03:00
parent 8d69e3e642
commit e536772dcb
5 changed files with 29 additions and 2 deletions

View file

@ -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)
}
});
},

View file

@ -88,6 +88,11 @@
<button type="button" class="btn btn-text-default" id="table-btn-slicer" style="width:100%;"><%= scope.textSlicer %></button>
</td>
</tr>
<tr class="pivot-only">
<td class="padding-small" colspan=2>
<button type="button" class="btn btn-text-default" id="table-btn-pivot" style="width:100%;"><%= scope.textPivot %></button>
</td>
</tr>
<tr>
<td class="padding-small" colspan=2>
<div class="separator horizontal"></div>

View file

@ -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;
},

View file

@ -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.<br>Are you sure you want to continue?',
textRemDuplicates: 'Remove duplicates',
textSlicer: 'Insert slicer'
textSlicer: 'Insert slicer',
textPivot: 'Insert pivot table'
}, SSE.Views.TableSettings || {}));
});

View file

@ -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.<br>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.",