mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-26 21:16:57 +08:00
[SSE] Sort pivot data from context menu
This commit is contained in:
@ -224,6 +224,7 @@ define([
|
||||
view.mnuSubtotalField.on('click', _.bind(me.onSubtotalField, me));
|
||||
view.mnuSummarize.menu.on('item:click', _.bind(me.onSummarize, me));
|
||||
view.mnuShowAs.menu.on('item:click', _.bind(me.onShowAs, me));
|
||||
view.mnuPivotSort.menu.on('item:click', _.bind(me.onPivotSort, me));
|
||||
view.mnuPivotFilter.menu.on('item:click', _.bind(me.onPivotFilter, me));
|
||||
view.pmiClear.menu.on('item:click', _.bind(me.onClear, me));
|
||||
view.pmiSelectTable.menu.on('item:click', _.bind(me.onSelectTable, me));
|
||||
@ -782,11 +783,6 @@ define([
|
||||
}
|
||||
} else if (item.value==='label') {
|
||||
this.showCustomFilterDlg(filter, item.value);
|
||||
// if (item.value == Asc.c_oAscCustomAutoFilter.isGreaterThan || item.value == Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo || item.value == Asc.c_oAscCustomAutoFilter.isLessThan ||
|
||||
// item.value == Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo || item.value == -2 || item.value == -3)
|
||||
// this.onNumCustomFilterItemClick(item);
|
||||
// else
|
||||
// this.onTextFilterMenuClick(menu, item);
|
||||
} else if (item.value==='top10') {
|
||||
var dlgTop10Filter = new SSE.Views.Top10FilterDialog({api:this.api, type: 'value'}).on({
|
||||
'close': function() {
|
||||
@ -801,6 +797,25 @@ define([
|
||||
}
|
||||
},
|
||||
|
||||
onPivotSort: function(menu, item, e) {
|
||||
if (!this.propsPivot.filter) return;
|
||||
|
||||
var filter = this.propsPivot.filter,
|
||||
me = this;
|
||||
if (item.value==='advanced') {
|
||||
var dlgSort = new SSE.Views.SortFilterDialog({api:this.api}).on({
|
||||
'close': function() {
|
||||
Common.NotificationCenter.trigger('edit:complete', me.documentHolder);
|
||||
}
|
||||
});
|
||||
dlgSort.setSettings(filter);
|
||||
dlgSort.show();
|
||||
} else {
|
||||
this.api.asc_sortColFilter(item.value, filter.asc_getCellId(), filter.asc_getDisplayName());
|
||||
Common.NotificationCenter.trigger('edit:complete', this.documentHolder);
|
||||
}
|
||||
},
|
||||
|
||||
fillPivotProps: function() {
|
||||
var props = this.propsPivot.originalProps;
|
||||
if (!props) return;
|
||||
@ -2622,6 +2637,7 @@ define([
|
||||
documentHolder.mnuSummarize.setVisible(!!this.propsPivot.field && (this.propsPivot.fieldType===2));
|
||||
documentHolder.mnuShowAs.setVisible(!!this.propsPivot.field && (this.propsPivot.fieldType===2) && !this.propsPivot.rowTotal && !this.propsPivot.colTotal);
|
||||
documentHolder.mnuPivotValueSeparator.setVisible(!!this.propsPivot.field && (this.propsPivot.fieldType===2));
|
||||
documentHolder.mnuPivotSort.setVisible(!!this.propsPivot.filter);
|
||||
documentHolder.mnuPivotFilter.setVisible(!!this.propsPivot.filter);
|
||||
documentHolder.mnuPivotFilterSeparator.setVisible(!!this.propsPivot.filter);
|
||||
|
||||
|
||||
@ -382,6 +382,28 @@ define([
|
||||
})
|
||||
});
|
||||
|
||||
me.mnuPivotSort = new Common.UI.MenuItem({
|
||||
caption : this.txtSort,
|
||||
menu : new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
menuAlign : 'tl-tr',
|
||||
items: [
|
||||
{
|
||||
iconCls: 'menu__icon btn-sort-down',
|
||||
caption : me.txtAscending,
|
||||
value : Asc.c_oAscSortOptions.Ascending
|
||||
},{
|
||||
iconCls: 'menu__icon btn-sort-up',
|
||||
caption : me.txtDescending,
|
||||
value : Asc.c_oAscSortOptions.Descending
|
||||
},{
|
||||
caption : me.txtSortOption,
|
||||
value : 'advanced'
|
||||
}
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
me.mnuDeleteField = new Common.UI.MenuItem({
|
||||
caption : this.txtDelField
|
||||
});
|
||||
@ -765,6 +787,7 @@ define([
|
||||
me.pmiReapply,
|
||||
me.mnuRefreshPivot,
|
||||
me.mnuPivotRefreshSeparator,
|
||||
me.mnuPivotSort,
|
||||
me.mnuPivotFilter,
|
||||
me.mnuPivotFilterSeparator,
|
||||
me.mnuSubtotalField,
|
||||
@ -1619,7 +1642,8 @@ define([
|
||||
txtValueFilter: 'Value filters',
|
||||
txtLabelFilter: 'Label filters',
|
||||
txtTop10: 'Top 10',
|
||||
txtClearPivotField: 'Clear filter from {0}'
|
||||
txtClearPivotField: 'Clear filter from {0}',
|
||||
txtSortOption: 'More sort options'
|
||||
|
||||
}, SSE.Views.DocumentHolder || {}));
|
||||
});
|
||||
Reference in New Issue
Block a user