diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index e26c5b81e..a2c425f69 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -216,6 +216,7 @@ define([ view.pmiFilterCells.menu.on('item:click', _.bind(me.onFilterCells, me)); view.pmiReapply.on('click', _.bind(me.onReapply, me)); view.pmiCondFormat.on('click', _.bind(me.onCondFormat, me)); + view.mnuRefreshPivot.on('click', _.bind(me.onRefreshPivot, me)); view.mnuGroupPivot.on('click', _.bind(me.onGroupPivot, me)); view.mnuUnGroupPivot.on('click', _.bind(me.onGroupPivot, me)); view.pmiClear.menu.on('item:click', _.bind(me.onClear, me)); @@ -576,6 +577,12 @@ define([ })).show(); }, + onRefreshPivot: function(){ + if (this.api) { + this.propsPivot.asc_refresh(this.api); + } + }, + onGroupPivot: function(item) { item.value=='grouping' ? this.api.asc_groupPivot() : this.api.asc_ungroupPivot(); }, @@ -2267,13 +2274,13 @@ define([ seltype !== Asc.c_oAscSelectionType.RangeChart && seltype !== Asc.c_oAscSelectionType.RangeChartText && seltype !== Asc.c_oAscSelectionType.RangeShapeText && seltype !== Asc.c_oAscSelectionType.RangeSlicer)) { if (!documentHolder.ssMenu || !showMenu && !documentHolder.ssMenu.isVisible()) return; - + this.propsPivot = cellinfo.asc_getPivotTableInfo(); var iscelledit = this.api.isCellEdited, formatTableInfo = cellinfo.asc_getFormatTableInfo(), isinsparkline = (cellinfo.asc_getSparklineInfo()!==null), isintable = (formatTableInfo !== null), ismultiselect = cellinfo.asc_getMultiselect(), - inPivot = !!cellinfo.asc_getPivotTableInfo(); + inPivot = !!this.propsPivot; documentHolder.ssMenu.formatTableName = (isintable) ? formatTableInfo.asc_getTableName() : null; documentHolder.ssMenu.cellColor = xfs.asc_getFillColor(); documentHolder.ssMenu.fontColor = xfs.asc_getFontColor(); @@ -2294,6 +2301,7 @@ define([ documentHolder.pmiFilterCells.setVisible(iscellmenu && !iscelledit && !diagramOrMergeEditor && !inPivot); documentHolder.pmiReapply.setVisible((iscellmenu||isallmenu) && !iscelledit && !diagramOrMergeEditor && !inPivot); documentHolder.pmiCondFormat.setVisible(!iscelledit && !diagramOrMergeEditor); + documentHolder.mnuRefreshPivot.setVisible(iscellmenu && !iscelledit && !diagramOrMergeEditor && inPivot); documentHolder.mnuGroupPivot.setVisible(iscellmenu && !iscelledit && !diagramOrMergeEditor && inPivot); documentHolder.mnuUnGroupPivot.setVisible(iscellmenu && !iscelledit && !diagramOrMergeEditor && inPivot); documentHolder.ssMenu.items[12].setVisible((iscellmenu||isallmenu||isinsparkline) && !iscelledit); @@ -2325,7 +2333,7 @@ define([ /** coauthoring begin **/ var celcomments = cellinfo.asc_getComments(); // celcomments===null - has comment, but no permissions to view it - documentHolder.ssMenu.items[19].setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && celcomments && (celcomments.length < 1)); + documentHolder.ssMenu.items[20].setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && celcomments && (celcomments.length < 1)); documentHolder.pmiAddComment.setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && celcomments && (celcomments.length < 1)); /** coauthoring end **/ documentHolder.pmiCellMenuSeparator.setVisible(iscellmenu && !iscelledit || isrowmenu || iscolmenu || isallmenu); @@ -2394,6 +2402,7 @@ define([ var canGroup = this.api.asc_canGroupPivot(); documentHolder.mnuGroupPivot.setDisabled(isPivotLocked || !canGroup || this._state.wsLock); documentHolder.mnuUnGroupPivot.setDisabled(isPivotLocked || !canGroup || this._state.wsLock); + documentHolder.mnuRefreshPivot.setDisabled(isPivotLocked || this._state.wsLock); } if (showMenu) this.showPopupMenu(documentHolder.ssMenu, {}, event); diff --git a/apps/spreadsheeteditor/main/app/view/DocumentHolder.js b/apps/spreadsheeteditor/main/app/view/DocumentHolder.js index 1cb8e067e..a1474e39e 100644 --- a/apps/spreadsheeteditor/main/app/view/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/view/DocumentHolder.js @@ -335,6 +335,10 @@ define([ caption : me.txtReapply }); + me.mnuRefreshPivot = new Common.UI.MenuItem({ + caption : me.txtRefresh + }); + me.mnuGroupPivot = new Common.UI.MenuItem({ caption : this.txtGroup, value : 'grouping' @@ -584,6 +588,7 @@ define([ me.pmiSortCells, me.pmiFilterCells, me.pmiReapply, + me.mnuRefreshPivot, me.mnuGroupPivot, me.mnuUnGroupPivot, {caption: '--'}, @@ -1319,7 +1324,8 @@ define([ tipMarkersDash: 'Dash bullets', chartDataText: 'Select Chart Data', chartTypeText: 'Change Chart Type', - txtGetLink: 'Get link to this range' + txtGetLink: 'Get link to this range', + txtRefresh: 'Refresh' }, 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 5f7e33fce..2145a9510 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -2242,6 +2242,7 @@ "SSE.Views.DocumentHolder.txtPaste": "Paste", "SSE.Views.DocumentHolder.txtPercentage": "Percentage", "SSE.Views.DocumentHolder.txtReapply": "Reapply", + "SSE.Views.DocumentHolder.txtRefresh": "Refresh", "SSE.Views.DocumentHolder.txtRow": "Entire row", "SSE.Views.DocumentHolder.txtRowHeight": "Set Row Height", "SSE.Views.DocumentHolder.txtScientific": "Scientific",