Merge branch 'feature/sse-pivot-settings' into develop
This commit is contained in:
commit
5f283b11ce
|
@ -152,7 +152,7 @@ define([
|
||||||
|
|
||||||
onApiSelectionChanged: function(info) {
|
onApiSelectionChanged: function(info) {
|
||||||
var seltype = info.asc_getFlags().asc_getSelectionType(),
|
var seltype = info.asc_getFlags().asc_getSelectionType(),
|
||||||
coauth_disable = (!this.mode.isEditMailMerge && !this.mode.isEditDiagram) ? (info.asc_getLocked() === true || info.asc_getLockedTable() === true) : false;
|
coauth_disable = (!this.mode.isEditMailMerge && !this.mode.isEditDiagram) ? (info.asc_getLocked() === true || info.asc_getLockedTable() === true || info.asc_getLockedPivotTable()===true) : false;
|
||||||
|
|
||||||
var is_chart_text = seltype == Asc.c_oAscSelectionType.RangeChartText,
|
var is_chart_text = seltype == Asc.c_oAscSelectionType.RangeChartText,
|
||||||
is_chart = seltype == Asc.c_oAscSelectionType.RangeChart,
|
is_chart = seltype == Asc.c_oAscSelectionType.RangeChart,
|
||||||
|
|
|
@ -1392,6 +1392,14 @@ define([
|
||||||
config.msg = this.errorLockedCellPivot;
|
config.msg = this.errorLockedCellPivot;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Asc.c_oAscError.ID.PivotLabledColumns:
|
||||||
|
config.msg = this.errorLabledColumnsPivot;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Asc.c_oAscError.ID.PivotOverlap:
|
||||||
|
config.msg = this.errorPivotOverlap;
|
||||||
|
break;
|
||||||
|
|
||||||
case Asc.c_oAscError.ID.ForceSaveButton:
|
case Asc.c_oAscError.ID.ForceSaveButton:
|
||||||
config.msg = this.errorForceSave;
|
config.msg = this.errorForceSave;
|
||||||
break;
|
break;
|
||||||
|
@ -2491,6 +2499,8 @@ define([
|
||||||
txtTab: 'Tab',
|
txtTab: 'Tab',
|
||||||
txtFile: 'File',
|
txtFile: 'File',
|
||||||
errorFileSizeExceed: 'The file size exceeds the limitation set for your server.<br>Please contact your Document Server administrator for details.',
|
errorFileSizeExceed: 'The file size exceeds the limitation set for your server.<br>Please contact your Document Server administrator for details.',
|
||||||
|
errorLabledColumnsPivot: 'To create a pivot table report, you must use data that is organized as a list with labeled columns.',
|
||||||
|
errorPivotOverlap: 'A pivot table report cannot overlap a table.',
|
||||||
txtColumn: 'Column',
|
txtColumn: 'Column',
|
||||||
txtRow: 'Row',
|
txtRow: 'Row',
|
||||||
errorUpdateVersionOnDisconnect: 'Internet connection has been restored, and the file version has been changed.<br>Before you can continue working, you need to download the file or copy its content to make sure nothing is lost, and then reload this page.',
|
errorUpdateVersionOnDisconnect: 'Internet connection has been restored, and the file version has been changed.<br>Before you can continue working, you need to download the file or copy its content to make sure nothing is lost, and then reload this page.',
|
||||||
|
|
|
@ -40,7 +40,8 @@
|
||||||
|
|
||||||
define([
|
define([
|
||||||
'core',
|
'core',
|
||||||
'spreadsheeteditor/main/app/view/PivotTable'
|
'spreadsheeteditor/main/app/view/PivotTable',
|
||||||
|
'spreadsheeteditor/main/app/view/CreatePivotDialog'
|
||||||
], function () {
|
], function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
@ -80,15 +81,13 @@ define([
|
||||||
};
|
};
|
||||||
this._originalProps = null;
|
this._originalProps = null;
|
||||||
|
|
||||||
this.view = this.createView('PivotTable');
|
|
||||||
|
|
||||||
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
||||||
Common.NotificationCenter.on('api:disconnect', _.bind(this.SetDisabled, this));
|
Common.NotificationCenter.on('api:disconnect', _.bind(this.SetDisabled, this));
|
||||||
},
|
},
|
||||||
|
|
||||||
setConfig: function (data, api) {
|
setConfig: function (data, api) {
|
||||||
|
this.view = this.createView('PivotTable');
|
||||||
this.setApi(api);
|
this.setApi(api);
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
this.sdkViewName = data['sdkviewname'] || this.sdkViewName;
|
this.sdkViewName = data['sdkviewname'] || this.sdkViewName;
|
||||||
}
|
}
|
||||||
|
@ -98,8 +97,10 @@ define([
|
||||||
if (api) {
|
if (api) {
|
||||||
this.api = api;
|
this.api = api;
|
||||||
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.SetDisabled, this));
|
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.SetDisabled, this));
|
||||||
|
Common.NotificationCenter.on('api:disconnect', _.bind(this.SetDisabled, this));
|
||||||
this.api.asc_registerCallback('asc_onSendThemeColors', _.bind(this.onSendThemeColors, this));
|
this.api.asc_registerCallback('asc_onSendThemeColors', _.bind(this.onSendThemeColors, this));
|
||||||
this.api.asc_registerCallback('asc_onSelectionChanged', _.bind(this.onSelectionChanged, this));
|
this.api.asc_registerCallback('asc_onSelectionChanged', _.bind(this.onSelectionChanged, this));
|
||||||
|
Common.NotificationCenter.on('cells:range', _.bind(this.onCellsRange, this));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -136,11 +137,49 @@ define([
|
||||||
Common.NotificationCenter.trigger('edit:complete', this);
|
Common.NotificationCenter.trigger('edit:complete', this);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
createSheetName: function() {
|
||||||
|
var items = [], wc = this.api.asc_getWorksheetsCount();
|
||||||
|
while (wc--) {
|
||||||
|
items.push(this.api.asc_getWorksheetName(wc).toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
|
var index = 0, name;
|
||||||
|
while(++index < 1000) {
|
||||||
|
name = this.strSheet + index;
|
||||||
|
if (items.indexOf(name.toLowerCase()) < 0) break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return name;
|
||||||
|
},
|
||||||
|
|
||||||
onCreateClick: function(btn, opts){
|
onCreateClick: function(btn, opts){
|
||||||
|
if (this.api) {
|
||||||
|
var options = this.api.asc_getAddPivotTableOptions();
|
||||||
|
if (options) {
|
||||||
|
var me = this;
|
||||||
|
(new SSE.Views.CreatePivotDialog(
|
||||||
|
{
|
||||||
|
props: options,
|
||||||
|
api: me.api,
|
||||||
|
handler: function(result, settings) {
|
||||||
|
if (result == 'ok' && settings) {
|
||||||
|
if (settings.destination)
|
||||||
|
me.api.asc_insertPivotExistingWorksheet(settings.source, settings.destination);
|
||||||
|
else
|
||||||
|
me.api.asc_insertPivotNewWorksheet(settings.source, me.createSheetName());
|
||||||
|
}
|
||||||
|
Common.NotificationCenter.trigger('edit:complete', me);
|
||||||
|
}
|
||||||
|
})).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
Common.NotificationCenter.trigger('edit:complete', this);
|
Common.NotificationCenter.trigger('edit:complete', this);
|
||||||
},
|
},
|
||||||
|
|
||||||
onRefreshClick: function(btn, opts){
|
onRefreshClick: function(btn, opts){
|
||||||
|
if (this.api) {
|
||||||
|
this._originalProps.asc_refresh(this.api);
|
||||||
|
}
|
||||||
Common.NotificationCenter.trigger('edit:complete', this);
|
Common.NotificationCenter.trigger('edit:complete', this);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -160,29 +199,37 @@ define([
|
||||||
|
|
||||||
onPivotBlankRows: function(type){
|
onPivotBlankRows: function(type){
|
||||||
if (this.api) {
|
if (this.api) {
|
||||||
if (type === 'insert'){
|
var props = new Asc.CT_pivotTableDefinition();
|
||||||
|
props.asc_setInsertBlankRow(type === 'insert');
|
||||||
} else {
|
this._originalProps.asc_set(this.api, props);
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Common.NotificationCenter.trigger('edit:complete', this);
|
Common.NotificationCenter.trigger('edit:complete', this);
|
||||||
},
|
},
|
||||||
|
|
||||||
onPivotLayout: function(type){
|
onPivotLayout: function(type){
|
||||||
if (this.api) {
|
if (this.api) {
|
||||||
|
var props = new Asc.CT_pivotTableDefinition();
|
||||||
switch (type){
|
switch (type){
|
||||||
case 0:
|
case 0:
|
||||||
|
props.asc_setCompact(true);
|
||||||
|
props.asc_setOutline(true);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
props.asc_setCompact(false);
|
||||||
|
props.asc_setOutline(true);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
props.asc_setCompact(false);
|
||||||
|
props.asc_setOutline(false);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
props.asc_setFillDownLabelsDefault(true);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
|
props.asc_setFillDownLabelsDefault(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
this._originalProps.asc_set(this.api, props);
|
||||||
}
|
}
|
||||||
Common.NotificationCenter.trigger('edit:complete', this);
|
Common.NotificationCenter.trigger('edit:complete', this);
|
||||||
},
|
},
|
||||||
|
@ -199,14 +246,21 @@ define([
|
||||||
|
|
||||||
onPivotSubtotals: function(type){
|
onPivotSubtotals: function(type){
|
||||||
if (this.api) {
|
if (this.api) {
|
||||||
|
var props = new Asc.CT_pivotTableDefinition();
|
||||||
switch (type){
|
switch (type){
|
||||||
case 0:
|
case 0:
|
||||||
|
props.asc_setDefaultSubtotal(false);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
props.asc_setDefaultSubtotal(true);
|
||||||
|
props.asc_setSubtotalTop(false);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
props.asc_setDefaultSubtotal(true);
|
||||||
|
props.asc_setSubtotalTop(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
this._originalProps.asc_set(this.api, props);
|
||||||
}
|
}
|
||||||
Common.NotificationCenter.trigger('edit:complete', this);
|
Common.NotificationCenter.trigger('edit:complete', this);
|
||||||
},
|
},
|
||||||
|
@ -323,16 +377,22 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onSelectionChanged: function(info) {
|
onSelectionChanged: function(info) {
|
||||||
if (this.rangeSelectionMode || !this.appConfig.isEdit) return;
|
if (this.rangeSelectionMode || !this.appConfig.isEdit || !this.view) return;
|
||||||
|
|
||||||
var selectType = info.asc_getFlags().asc_getSelectionType(),
|
var selectType = info.asc_getFlags().asc_getSelectionType(),
|
||||||
pivotInfo = info.asc_getPivotTableInfo();
|
pivotInfo = info.asc_getPivotTableInfo();
|
||||||
|
|
||||||
this.view.SetDisabled(!pivotInfo || info.asc_getLockedPivotTable());
|
Common.Utils.lockControls(SSE.enumLock.noPivot, !pivotInfo, {array: this.view.lockedControls});
|
||||||
|
Common.Utils.lockControls(SSE.enumLock.editPivot, !!pivotInfo, {array: [this.view.btnAddPivot]});
|
||||||
|
|
||||||
if (pivotInfo)
|
if (pivotInfo)
|
||||||
this.ChangeSettings(pivotInfo);
|
this.ChangeSettings(pivotInfo);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onCellsRange: function(status) {
|
||||||
|
this.rangeSelectionMode = (status != Asc.c_oAscSelectionDialogType.None);
|
||||||
|
},
|
||||||
|
|
||||||
createToolbarPanel: function() {
|
createToolbarPanel: function() {
|
||||||
return this.view.getPanel();
|
return this.view.getPanel();
|
||||||
},
|
},
|
||||||
|
@ -348,7 +408,9 @@ define([
|
||||||
resolve();
|
resolve();
|
||||||
})).then(function () {
|
})).then(function () {
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
|
|
||||||
|
strSheet : 'Sheet'
|
||||||
|
|
||||||
}, SSE.Controllers.PivotTable || {}));
|
}, SSE.Controllers.PivotTable || {}));
|
||||||
});
|
});
|
|
@ -121,7 +121,7 @@ define([
|
||||||
formatTableInfo = info.asc_getFormatTableInfo(),
|
formatTableInfo = info.asc_getFormatTableInfo(),
|
||||||
sparkLineInfo = info.asc_getSparklineInfo(),
|
sparkLineInfo = info.asc_getSparklineInfo(),
|
||||||
cellInfo = info,
|
cellInfo = info,
|
||||||
pivotInfo = null;//info.asc_getPivotTableInfo();
|
pivotInfo = info.asc_getPivotTableInfo();
|
||||||
|
|
||||||
if (selectType == Asc.c_oAscSelectionType.RangeImage || selectType == Asc.c_oAscSelectionType.RangeShape ||
|
if (selectType == Asc.c_oAscSelectionType.RangeImage || selectType == Asc.c_oAscSelectionType.RangeShape ||
|
||||||
selectType == Asc.c_oAscSelectionType.RangeChart || selectType == Asc.c_oAscSelectionType.RangeChartText || selectType == Asc.c_oAscSelectionType.RangeShapeText) {
|
selectType == Asc.c_oAscSelectionType.RangeChart || selectType == Asc.c_oAscSelectionType.RangeChartText || selectType == Asc.c_oAscSelectionType.RangeShapeText) {
|
||||||
|
@ -200,12 +200,12 @@ define([
|
||||||
this._settings[settingsType].btn.updateHint(this.rightmenu.txtSparklineSettings);
|
this._settings[settingsType].btn.updateHint(this.rightmenu.txtSparklineSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (pivotInfo) {
|
if (pivotInfo) {
|
||||||
// settingsType = Common.Utils.documentSettingsType.Pivot;
|
settingsType = Common.Utils.documentSettingsType.Pivot;
|
||||||
// this._settings[settingsType].props = pivotInfo;
|
this._settings[settingsType].props = pivotInfo;
|
||||||
// this._settings[settingsType].locked = isPivotLocked || true; // disable pivot settings
|
this._settings[settingsType].locked = isPivotLocked; // disable pivot settings
|
||||||
// this._settings[settingsType].hidden = 0;
|
this._settings[settingsType].hidden = 0;
|
||||||
// }
|
}
|
||||||
|
|
||||||
if (SelectedObjects.length<=0) { // cell is selected
|
if (SelectedObjects.length<=0) { // cell is selected
|
||||||
settingsType = Common.Utils.documentSettingsType.Cell;
|
settingsType = Common.Utils.documentSettingsType.Cell;
|
||||||
|
|
|
@ -2005,7 +2005,7 @@ define([
|
||||||
return this.onApiSelectionChanged_MailMergeEditor(info);
|
return this.onApiSelectionChanged_MailMergeEditor(info);
|
||||||
|
|
||||||
var selectionType = info.asc_getFlags().asc_getSelectionType(),
|
var selectionType = info.asc_getFlags().asc_getSelectionType(),
|
||||||
coauth_disable = (!this.toolbar.mode.isEditMailMerge && !this.toolbar.mode.isEditDiagram) ? (info.asc_getLocked()===true || info.asc_getLockedTable()===true) : false,
|
coauth_disable = (!this.toolbar.mode.isEditMailMerge && !this.toolbar.mode.isEditDiagram) ? (info.asc_getLocked()===true || info.asc_getLockedTable()===true || info.asc_getLockedPivotTable()===true) : false,
|
||||||
editOptionsDisabled = this._disableEditOptions(selectionType, coauth_disable),
|
editOptionsDisabled = this._disableEditOptions(selectionType, coauth_disable),
|
||||||
me = this,
|
me = this,
|
||||||
toolbar = this.toolbar,
|
toolbar = this.toolbar,
|
||||||
|
@ -3182,11 +3182,13 @@ define([
|
||||||
Array.prototype.push.apply(me.toolbar.lockControls, formulatab.getButtons());
|
Array.prototype.push.apply(me.toolbar.lockControls, formulatab.getButtons());
|
||||||
|
|
||||||
if ( !config.isOffline ) {
|
if ( !config.isOffline ) {
|
||||||
var tab = {action: 'pivot', caption: me.textPivot};
|
tab = {action: 'pivot', caption: me.textPivot};
|
||||||
var $panel = me.getApplication().getController('PivotTable').createToolbarPanel();
|
var pivottab = me.getApplication().getController('PivotTable');
|
||||||
|
$panel = pivottab.createToolbarPanel();
|
||||||
if ($panel) {
|
if ($panel) {
|
||||||
me.toolbar.addTab(tab, $panel, 5);
|
me.toolbar.addTab(tab, $panel, 5);
|
||||||
me.toolbar.setVisible('pivot', true);
|
me.toolbar.setVisible('pivot', true);
|
||||||
|
Array.prototype.push.apply(me.toolbar.lockControls, pivottab.getView('PivotTable').getButtons());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
<button id="id-right-menu-chart" class="btn btn-category arrow-left" content-target="id-chart-settings"><i class="icon toolbar__icon btn-menu-chart"> </i></button>
|
<button id="id-right-menu-chart" class="btn btn-category arrow-left" content-target="id-chart-settings"><i class="icon toolbar__icon btn-menu-chart"> </i></button>
|
||||||
<button id="id-right-menu-text" class="btn btn-category arrow-left" content-target="id-paragraph-settings"><i class="icon toolbar__icon btn-paragraph"> </i></button>
|
<button id="id-right-menu-text" class="btn btn-category arrow-left" content-target="id-paragraph-settings"><i class="icon toolbar__icon btn-paragraph"> </i></button>
|
||||||
<button id="id-right-menu-textart" class="btn btn-category arrow-left" content-target="id-textart-settings"><i class="icon toolbar__icon btn-menu-textart"> </i></button>
|
<button id="id-right-menu-textart" class="btn btn-category arrow-left" content-target="id-textart-settings"><i class="icon toolbar__icon btn-menu-textart"> </i></button>
|
||||||
<button id="id-right-menu-pivot" class="btn btn-category arrow-left hidden" content-target="id-pivot-settings"><i class="icon toolbar__icon btn-menu-pivot"> </i></button>
|
<button id="id-right-menu-pivot" class="btn btn-category arrow-left" content-target="id-pivot-settings"><i class="icon toolbar__icon btn-menu-pivot"> </i></button>
|
||||||
<button id="id-right-menu-signature" class="btn btn-category arrow-left hidden" content-target="id-signature-settings"><i class="icon toolbar__icon btn-menu-signature"> </i></button>
|
<button id="id-right-menu-signature" class="btn btn-category arrow-left hidden" content-target="id-signature-settings"><i class="icon toolbar__icon btn-menu-signature"> </i></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
293
apps/spreadsheeteditor/main/app/view/CreatePivotDialog.js
Normal file
293
apps/spreadsheeteditor/main/app/view/CreatePivotDialog.js
Normal file
|
@ -0,0 +1,293 @@
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* (c) Copyright Ascensio System SIA 2010-2019
|
||||||
|
*
|
||||||
|
* This program is a free software product. You can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||||
|
* version 3 as published by the Free Software Foundation. In accordance with
|
||||||
|
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||||
|
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||||
|
* of any third-party rights.
|
||||||
|
*
|
||||||
|
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||||
|
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||||
|
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||||
|
*
|
||||||
|
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
||||||
|
* street, Riga, Latvia, EU, LV-1050.
|
||||||
|
*
|
||||||
|
* The interactive user interfaces in modified source and object code versions
|
||||||
|
* of the Program must display Appropriate Legal Notices, as required under
|
||||||
|
* Section 5 of the GNU AGPL version 3.
|
||||||
|
*
|
||||||
|
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||||
|
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||||
|
* grant you any rights under trademark law for use of our trademarks.
|
||||||
|
*
|
||||||
|
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||||
|
* well as technical writing content are licensed under the terms of the
|
||||||
|
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||||
|
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CreatePivotDialog.js
|
||||||
|
*
|
||||||
|
* Created by Julia Radzhabova on 04.10.2019
|
||||||
|
* Copyright (c) 2019 Ascensio System SIA. All rights reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
define([
|
||||||
|
'common/main/lib/util/utils',
|
||||||
|
'common/main/lib/component/InputField',
|
||||||
|
'common/main/lib/component/ComboBox',
|
||||||
|
'common/main/lib/view/AdvancedSettingsWindow'
|
||||||
|
], function () { 'use strict';
|
||||||
|
|
||||||
|
SSE.Views.CreatePivotDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({
|
||||||
|
options: {
|
||||||
|
contentWidth: 330,
|
||||||
|
height: 250
|
||||||
|
},
|
||||||
|
|
||||||
|
initialize : function(options) {
|
||||||
|
var me = this;
|
||||||
|
|
||||||
|
_.extend(this.options, {
|
||||||
|
title: this.textTitle,
|
||||||
|
template: [
|
||||||
|
'<div class="box" style="height:' + (me.options.height - 85) + 'px;">',
|
||||||
|
'<div class="content-panel" style="padding: 0 10px;"><div class="inner-content">',
|
||||||
|
'<div class="settings-panel active">',
|
||||||
|
'<table cols="1" style="width: 100%;">',
|
||||||
|
'<tr>',
|
||||||
|
'<td style="padding-bottom: 2px;">',
|
||||||
|
'<label class="input-label">' + me.textDataRange + '</label>',
|
||||||
|
'</td>',
|
||||||
|
'</tr>',
|
||||||
|
'<tr>',
|
||||||
|
'<td class="padding-large">',
|
||||||
|
'<div id="create-pivot-input-source" class="input-row" style="display: inline-block; vertical-align: middle; margin-right: 10px;width: 213px;"></div>',
|
||||||
|
'<button type="button" class="btn btn-text-default" id="create-pivot-btn-source" style="width: 86px;">' + me.textSelectData + '</button>',
|
||||||
|
'</td>',
|
||||||
|
'</tr>',
|
||||||
|
'<tr>',
|
||||||
|
'<td class="padding-small">',
|
||||||
|
'<label class="input-label">' + me.textDestination + '</label>',
|
||||||
|
'</td>',
|
||||||
|
'</tr>',
|
||||||
|
'<tr>',
|
||||||
|
'<td class="padding-small">',
|
||||||
|
'<div id="create-pivot-radio-new"></div>',
|
||||||
|
'</td>',
|
||||||
|
'</tr>',
|
||||||
|
'<tr>',
|
||||||
|
'<td class="padding-small">',
|
||||||
|
'<div id="create-pivot-radio-exist"></div>',
|
||||||
|
'</td>',
|
||||||
|
'</tr>',
|
||||||
|
'<tr>',
|
||||||
|
'<td>',
|
||||||
|
'<div id="create-pivot-input-dest" class="input-row" style="margin-left: 22px; display: inline-block; vertical-align: middle; margin-right: 10px;width: 191px;"></div>',
|
||||||
|
'<button type="button" class="btn btn-text-default" id="create-pivot-btn-dest" style="width: 86px;">' + me.textSelectData + '</button>',
|
||||||
|
'</td>',
|
||||||
|
'</tr>',
|
||||||
|
'</table>',
|
||||||
|
'</div></div>',
|
||||||
|
'</div>',
|
||||||
|
'</div>'
|
||||||
|
].join('')
|
||||||
|
}, options);
|
||||||
|
|
||||||
|
this.api = options.api;
|
||||||
|
this.props = options.props;
|
||||||
|
|
||||||
|
this.options.handler = function(result, value) {
|
||||||
|
if ( result != 'ok' || this.isRangeValid() ) {
|
||||||
|
if (options.handler)
|
||||||
|
options.handler.call(this, result, value);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.dataSourceValid = '';
|
||||||
|
this.dataDestValid = '';
|
||||||
|
|
||||||
|
Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
|
||||||
|
},
|
||||||
|
|
||||||
|
render: function() {
|
||||||
|
Common.Views.AdvancedSettingsWindow.prototype.render.call(this);
|
||||||
|
var me = this;
|
||||||
|
|
||||||
|
this.txtSourceRange = new Common.UI.InputField({
|
||||||
|
el : $('#create-pivot-input-source'),
|
||||||
|
name : 'range',
|
||||||
|
style : 'width: 100%;',
|
||||||
|
allowBlank : true,
|
||||||
|
validateOnChange: true
|
||||||
|
});
|
||||||
|
|
||||||
|
this.btnSelectSource = new Common.UI.Button({
|
||||||
|
el: $('#create-pivot-btn-source')
|
||||||
|
});
|
||||||
|
this.btnSelectSource.on('click', _.bind(this.onSelectData, this, 'source'));
|
||||||
|
|
||||||
|
this.txtDestRange = new Common.UI.InputField({
|
||||||
|
el : $('#create-pivot-input-dest'),
|
||||||
|
name : 'range',
|
||||||
|
style : 'width: 100%;',
|
||||||
|
allowBlank : true,
|
||||||
|
validateOnChange: true,
|
||||||
|
validateOnBlur: false,
|
||||||
|
disabled: true
|
||||||
|
});
|
||||||
|
|
||||||
|
this.btnSelectDest = new Common.UI.Button({
|
||||||
|
el: $('#create-pivot-btn-dest'),
|
||||||
|
disabled: true
|
||||||
|
});
|
||||||
|
this.btnSelectDest.on('click', _.bind(this.onSelectData, this, 'dest'));
|
||||||
|
|
||||||
|
this.radioNew = new Common.UI.RadioBox({
|
||||||
|
el: $('#create-pivot-radio-new'),
|
||||||
|
labelText: this.textNew,
|
||||||
|
name: 'asc-radio-pivot-dest',
|
||||||
|
checked: true
|
||||||
|
}).on('change', function(field, newValue) {
|
||||||
|
me.txtDestRange.setDisabled(newValue);
|
||||||
|
me.btnSelectDest.setDisabled(newValue);
|
||||||
|
me.txtDestRange.showError();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.radioExist = new Common.UI.RadioBox({
|
||||||
|
el: $('#create-pivot-radio-exist'),
|
||||||
|
labelText: this.textExist,
|
||||||
|
name: 'asc-radio-pivot-dest'
|
||||||
|
}).on('change', function(field, newValue) {
|
||||||
|
me.txtDestRange.setDisabled(!newValue);
|
||||||
|
me.btnSelectDest.setDisabled(!newValue);
|
||||||
|
me.txtDestRange.cmpEl.find('input').focus();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.afterRender();
|
||||||
|
},
|
||||||
|
|
||||||
|
afterRender: function() {
|
||||||
|
this._setDefaults(this.props);
|
||||||
|
},
|
||||||
|
|
||||||
|
show: function() {
|
||||||
|
Common.Views.AdvancedSettingsWindow.prototype.show.apply(this, arguments);
|
||||||
|
|
||||||
|
var me = this;
|
||||||
|
_.delay(function(){
|
||||||
|
me.txtSourceRange.cmpEl.find('input').focus();
|
||||||
|
},50);
|
||||||
|
},
|
||||||
|
|
||||||
|
_setDefaults: function (props) {
|
||||||
|
if (props) {
|
||||||
|
var value = props.asc_getRange();
|
||||||
|
this.txtSourceRange.setValue((value) ? value : '');
|
||||||
|
this.dataSourceValid = value;
|
||||||
|
|
||||||
|
var me = this;
|
||||||
|
this.txtSourceRange.validation = function(value) {
|
||||||
|
var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PivotTableData, value, false);
|
||||||
|
return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true;
|
||||||
|
};
|
||||||
|
this.txtDestRange.validation = function(value) {
|
||||||
|
var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PivotTableReport, value, false);
|
||||||
|
return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
getSettings: function () {
|
||||||
|
var source = this.txtSourceRange.getValue(),
|
||||||
|
dest = this.radioExist.getValue() ? this.txtDestRange.getValue() : null;
|
||||||
|
|
||||||
|
return {source: source, destination: dest};
|
||||||
|
},
|
||||||
|
|
||||||
|
isRangeValid: function() {
|
||||||
|
var isvalid = true,
|
||||||
|
txtError = '';
|
||||||
|
|
||||||
|
if (_.isEmpty(this.txtSourceRange.getValue())) {
|
||||||
|
isvalid = false;
|
||||||
|
txtError = this.txtEmpty;
|
||||||
|
} else {
|
||||||
|
isvalid = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PivotTableData, this.txtSourceRange.getValue());
|
||||||
|
isvalid = (isvalid == Asc.c_oAscError.ID.No);
|
||||||
|
!isvalid && (txtError = this.textInvalidRange);
|
||||||
|
}
|
||||||
|
if (!isvalid) {
|
||||||
|
this.txtSourceRange.showError([txtError]);
|
||||||
|
this.txtSourceRange.cmpEl.find('input').focus();
|
||||||
|
return isvalid;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.radioExist.getValue()) {
|
||||||
|
if (_.isEmpty(this.txtDestRange.getValue())) {
|
||||||
|
isvalid = false;
|
||||||
|
txtError = this.txtEmpty;
|
||||||
|
} else {
|
||||||
|
isvalid = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PivotTableReport, this.txtDestRange.getValue());
|
||||||
|
isvalid = (isvalid == Asc.c_oAscError.ID.No);
|
||||||
|
!isvalid && (txtError = this.textInvalidRange);
|
||||||
|
}
|
||||||
|
if (!isvalid) {
|
||||||
|
this.txtDestRange.showError([txtError]);
|
||||||
|
this.txtDestRange.cmpEl.find('input').focus();
|
||||||
|
return isvalid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return isvalid;
|
||||||
|
},
|
||||||
|
|
||||||
|
onSelectData: function(type) {
|
||||||
|
var me = this,
|
||||||
|
txtRange = (type=='source') ? me.txtSourceRange : me.txtDestRange;
|
||||||
|
|
||||||
|
if (me.api) {
|
||||||
|
var handlerDlg = function(dlg, result) {
|
||||||
|
if (result == 'ok') {
|
||||||
|
var txt = dlg.getSettings();
|
||||||
|
(type=='source') ? (me.dataSourceValid = txt) : (me.dataDestValid = txt);
|
||||||
|
txtRange.setValue(txt);
|
||||||
|
txtRange.checkValidate();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var win = new SSE.Views.CellRangeDialog({
|
||||||
|
handler: handlerDlg
|
||||||
|
}).on('close', function() {
|
||||||
|
me.show();
|
||||||
|
});
|
||||||
|
|
||||||
|
var xy = me.$window.offset();
|
||||||
|
me.hide();
|
||||||
|
win.show(xy.left + 160, xy.top + 125);
|
||||||
|
win.setSettings({
|
||||||
|
api : me.api,
|
||||||
|
range : (!_.isEmpty(txtRange.getValue()) && (txtRange.checkValidate()==true)) ? txtRange.getValue() : ((type=='source') ? me.dataSourceValid : me.dataDestValid),
|
||||||
|
type : (type=='source') ? Asc.c_oAscSelectionDialogType.PivotTableData : Asc.c_oAscSelectionDialogType.PivotTableReport
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
textTitle: 'Create Table',
|
||||||
|
textDataRange: 'Source data range',
|
||||||
|
textSelectData: 'Select',
|
||||||
|
textDestination: 'Choose, where to place the table',
|
||||||
|
textNew: 'New worksheet',
|
||||||
|
textExist: 'Existing worksheet',
|
||||||
|
txtEmpty: 'This field is required',
|
||||||
|
textInvalidRange: 'Invalid cells range'
|
||||||
|
}, SSE.Views.CreatePivotDialog || {}))
|
||||||
|
});
|
|
@ -227,14 +227,22 @@ define([ 'text!spreadsheeteditor/main/app/template/FieldSettingsDialog.templa
|
||||||
_setDefaults: function (props) {
|
_setDefaults: function (props) {
|
||||||
if (props) {
|
if (props) {
|
||||||
var me = this,
|
var me = this,
|
||||||
cache_names = props.asc_getCacheFields(),
|
|
||||||
field = props.asc_getPivotFields()[this.fieldIndex];
|
field = props.asc_getPivotFields()[this.fieldIndex];
|
||||||
|
|
||||||
this.lblSourceName.html(Common.Utils.String.htmlEncode(cache_names[this.fieldIndex].asc_getName()));
|
this.lblSourceName.html(Common.Utils.String.htmlEncode(props.getCacheFieldName(this.fieldIndex)));
|
||||||
this.inputCustomName.setValue(Common.Utils.String.htmlEncode((field || cache_names[this.fieldIndex]).asc_getName()));
|
this.inputCustomName.setValue(Common.Utils.String.htmlEncode(props.getPivotFieldName(this.fieldIndex)));
|
||||||
|
|
||||||
|
(field.asc_getOutline()) ? this.radioOutline.setValue(true) : this.radioTabular.setValue(true);
|
||||||
|
this.chCompact.setValue(field.asc_getOutline() && field.asc_getCompact());
|
||||||
|
|
||||||
|
this.chRepeat.setValue(field.asc_getFillDownLabelsDefault());
|
||||||
|
this.chBlank.setValue(field.asc_getInsertBlankRow());
|
||||||
|
|
||||||
|
this.chSubtotals.setValue(field.asc_getDefaultSubtotal());
|
||||||
(field.asc_getSubtotalTop()) ? this.radioTop.setValue(true) : this.radioBottom.setValue(true);
|
(field.asc_getSubtotalTop()) ? this.radioTop.setValue(true) : this.radioBottom.setValue(true);
|
||||||
|
|
||||||
|
this.chEmpty.setValue(field.asc_getShowAll());
|
||||||
|
if (field.asc_getDefaultSubtotal()) {
|
||||||
var arr = field.asc_getSubtotals();
|
var arr = field.asc_getSubtotals();
|
||||||
if (arr) {
|
if (arr) {
|
||||||
_.each(arr, function(item) {
|
_.each(arr, function(item) {
|
||||||
|
@ -243,7 +251,7 @@ define([ 'text!spreadsheeteditor/main/app/template/FieldSettingsDialog.templa
|
||||||
me.chSum.setValue(true);
|
me.chSum.setValue(true);
|
||||||
break;
|
break;
|
||||||
case Asc.c_oAscItemType.Count:
|
case Asc.c_oAscItemType.Count:
|
||||||
me.chCount.setValue(true);
|
me.chNum.setValue(true);
|
||||||
break;
|
break;
|
||||||
case Asc.c_oAscItemType.Avg:
|
case Asc.c_oAscItemType.Avg:
|
||||||
me.chAve.setValue(true);
|
me.chAve.setValue(true);
|
||||||
|
@ -258,7 +266,7 @@ define([ 'text!spreadsheeteditor/main/app/template/FieldSettingsDialog.templa
|
||||||
me.chProduct.setValue(true);
|
me.chProduct.setValue(true);
|
||||||
break;
|
break;
|
||||||
case Asc.c_oAscItemType.CountA:
|
case Asc.c_oAscItemType.CountA:
|
||||||
me.chNum.setValue(true);
|
me.chCount.setValue(true);
|
||||||
break;
|
break;
|
||||||
case Asc.c_oAscItemType.StdDev:
|
case Asc.c_oAscItemType.StdDev:
|
||||||
me.chDev.setValue(true);
|
me.chDev.setValue(true);
|
||||||
|
@ -276,10 +284,62 @@ define([ 'text!spreadsheeteditor/main/app/template/FieldSettingsDialog.templa
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getSettings: function () {
|
getSettings: function () {
|
||||||
return {};
|
var field = new Asc.CT_PivotField();
|
||||||
|
field.asc_setName(this.inputCustomName.getValue());
|
||||||
|
|
||||||
|
field.asc_setOutline(this.radioOutline.getValue());
|
||||||
|
field.asc_setCompact(this.radioOutline.getValue() && this.chCompact.getValue() == 'checked');
|
||||||
|
|
||||||
|
field.asc_setFillDownLabelsDefault(this.chRepeat.getValue() == 'checked');
|
||||||
|
field.asc_setInsertBlankRow(this.chBlank.getValue() == 'checked');
|
||||||
|
|
||||||
|
field.asc_setDefaultSubtotal(this.chSubtotals.getValue() == 'checked');
|
||||||
|
field.asc_setSubtotalTop(this.radioTop.getValue());
|
||||||
|
|
||||||
|
field.asc_setShowAll(this.chEmpty.getValue() == 'checked');
|
||||||
|
if (field.asc_getDefaultSubtotal()) {
|
||||||
|
var arr = [];
|
||||||
|
if (this.chSum.getValue() == 'checked') {
|
||||||
|
arr.push(Asc.c_oAscItemType.Sum);
|
||||||
|
}
|
||||||
|
if (this.chNum.getValue() == 'checked') {
|
||||||
|
arr.push(Asc.c_oAscItemType.Count);
|
||||||
|
}
|
||||||
|
if (this.chAve.getValue() == 'checked') {
|
||||||
|
arr.push(Asc.c_oAscItemType.Avg);
|
||||||
|
}
|
||||||
|
if (this.chMax.getValue() == 'checked') {
|
||||||
|
arr.push(Asc.c_oAscItemType.Max);
|
||||||
|
}
|
||||||
|
if (this.chMin.getValue() == 'checked') {
|
||||||
|
arr.push(Asc.c_oAscItemType.Min);
|
||||||
|
}
|
||||||
|
if (this.chProduct.getValue() == 'checked') {
|
||||||
|
arr.push(Asc.c_oAscItemType.Product);
|
||||||
|
}
|
||||||
|
if (this.chCount.getValue() == 'checked') {
|
||||||
|
arr.push(Asc.c_oAscItemType.CountA);
|
||||||
|
}
|
||||||
|
if (this.chDev.getValue() == 'checked') {
|
||||||
|
arr.push(Asc.c_oAscItemType.StdDev);
|
||||||
|
}
|
||||||
|
if (this.chDevp.getValue() == 'checked') {
|
||||||
|
arr.push(Asc.c_oAscItemType.StdDevP);
|
||||||
|
}
|
||||||
|
if (this.chVar.getValue() == 'checked') {
|
||||||
|
arr.push(Asc.c_oAscItemType.Var);
|
||||||
|
}
|
||||||
|
if (this.chVarp.getValue() == 'checked') {
|
||||||
|
arr.push(Asc.c_oAscItemType.VarP);
|
||||||
|
}
|
||||||
|
field.asc_setSubtotals(arr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return field;
|
||||||
},
|
},
|
||||||
|
|
||||||
onDlgBtnClick: function(event) {
|
onDlgBtnClick: function(event) {
|
||||||
|
|
|
@ -107,19 +107,23 @@ define([
|
||||||
itemTemplate: _.template([
|
itemTemplate: _.template([
|
||||||
'<div>',
|
'<div>',
|
||||||
'<label class="checkbox-indeterminate" style="position:absolute;">',
|
'<label class="checkbox-indeterminate" style="position:absolute;">',
|
||||||
'<% if (check) { %>',
|
'<input id="pvcheckbox-<%= id %>" type="checkbox" class="button__checkbox">',
|
||||||
'<input type="button" class="checked button__checkbox"/>',
|
'<label for="pvcheckbox-<%= id %>" class="checkbox__shape" />',
|
||||||
'<% } else { %>',
|
|
||||||
'<input type="button" class="button__checkbox"/>',
|
|
||||||
'<% } %>',
|
|
||||||
'<span class="checkmark"/>',
|
|
||||||
'</label>',
|
'</label>',
|
||||||
'<div id="<%= id %>" class="list-item" style="pointer-events:none;"><%= Common.Utils.String.htmlEncode(value) %></div>',
|
'<div id="<%= id %>" class="list-item" style="pointer-events:none;"><span style="background-color: transparent;"><%= Common.Utils.String.htmlEncode(value) %></span></div>',
|
||||||
'<div class="listitem-icon img-commonctrl"></div>',
|
'<div class="listitem-icon img-commonctrl"></div>',
|
||||||
'</div>'
|
'</div>'
|
||||||
].join(''))
|
].join(''))
|
||||||
});
|
});
|
||||||
this.fieldsList.on('item:click', _.bind(this.onFieldsCheck, this));
|
this.fieldsList.on({
|
||||||
|
'item:change': this.onItemChanged.bind(this),
|
||||||
|
'item:add': this.onItemChanged.bind(this),
|
||||||
|
'item:click': this.onFieldsCheck.bind(this)
|
||||||
|
});
|
||||||
|
this.fieldsList.$el.on('dragenter', _.bind(this.onDragEnter, this));
|
||||||
|
this.fieldsList.$el.on('dragover', _.bind(this.onDragOver, this, this.fieldsList));
|
||||||
|
this.fieldsList.$el.on('dragleave', _.bind(this.onDragLeave, this, this.fieldsList));
|
||||||
|
this.fieldsList.$el.on('drop', _.bind(this.onDrop, this));
|
||||||
// this.fieldsList.onKeyDown = _.bind(this.onFieldsListKeyDown, this);
|
// this.fieldsList.onKeyDown = _.bind(this.onFieldsListKeyDown, this);
|
||||||
this.lockedControls.push(this.fieldsList);
|
this.lockedControls.push(this.fieldsList);
|
||||||
|
|
||||||
|
@ -127,7 +131,7 @@ define([
|
||||||
|
|
||||||
var itemTemplate = _.template([
|
var itemTemplate = _.template([
|
||||||
'<div id="<%= id %>" class="list-item" style="display:inline-block;">',
|
'<div id="<%= id %>" class="list-item" style="display:inline-block;">',
|
||||||
'<div style=""><%= Common.Utils.String.htmlEncode(value) %></div>',
|
'<div style=""><span><%= Common.Utils.String.htmlEncode(value) %></span></div>',
|
||||||
'<div class="listitem-icon img-commonctrl"></div>',
|
'<div class="listitem-icon img-commonctrl"></div>',
|
||||||
'</div>'
|
'</div>'
|
||||||
].join(''));
|
].join(''));
|
||||||
|
@ -139,6 +143,10 @@ define([
|
||||||
itemTemplate: itemTemplate
|
itemTemplate: itemTemplate
|
||||||
});
|
});
|
||||||
this.columnsList.on('item:click', _.bind(this.onColumnsSelect, this, 0));
|
this.columnsList.on('item:click', _.bind(this.onColumnsSelect, this, 0));
|
||||||
|
this.columnsList.$el.on('dragenter', _.bind(this.onDragEnter, this));
|
||||||
|
this.columnsList.$el.on('dragover', _.bind(this.onDragOver, this, this.columnsList));
|
||||||
|
this.columnsList.$el.on('dragleave', _.bind(this.onDragLeave, this, this.columnsList));
|
||||||
|
this.columnsList.$el.on('drop', _.bind(this.onDrop, this));
|
||||||
// this.columnsList.onKeyDown = _.bind(this.onColumnsListKeyDown, this);
|
// this.columnsList.onKeyDown = _.bind(this.onColumnsListKeyDown, this);
|
||||||
this.lockedControls.push(this.columnsList);
|
this.lockedControls.push(this.columnsList);
|
||||||
|
|
||||||
|
@ -150,6 +158,10 @@ define([
|
||||||
itemTemplate: itemTemplate
|
itemTemplate: itemTemplate
|
||||||
});
|
});
|
||||||
this.rowsList.on('item:click', _.bind(this.onColumnsSelect, this, 1));
|
this.rowsList.on('item:click', _.bind(this.onColumnsSelect, this, 1));
|
||||||
|
this.rowsList.$el.on('dragenter', _.bind(this.onDragEnter, this));
|
||||||
|
this.rowsList.$el.on('dragover', _.bind(this.onDragOver, this, this.rowsList));
|
||||||
|
this.rowsList.$el.on('dragleave', _.bind(this.onDragLeave, this, this.rowsList));
|
||||||
|
this.rowsList.$el.on('drop', _.bind(this.onDrop, this));
|
||||||
// this.rowsList.onKeyDown = _.bind(this.onRowsListKeyDown, this);
|
// this.rowsList.onKeyDown = _.bind(this.onRowsListKeyDown, this);
|
||||||
this.lockedControls.push(this.rowsList);
|
this.lockedControls.push(this.rowsList);
|
||||||
|
|
||||||
|
@ -161,6 +173,10 @@ define([
|
||||||
itemTemplate: itemTemplate
|
itemTemplate: itemTemplate
|
||||||
});
|
});
|
||||||
this.valuesList.on('item:click', _.bind(this.onColumnsSelect, this, 2));
|
this.valuesList.on('item:click', _.bind(this.onColumnsSelect, this, 2));
|
||||||
|
this.valuesList.$el.on('dragenter', _.bind(this.onDragEnter, this));
|
||||||
|
this.valuesList.$el.on('dragover', _.bind(this.onDragOver, this, this.valuesList));
|
||||||
|
this.valuesList.$el.on('dragleave', _.bind(this.onDragLeave, this, this.valuesList));
|
||||||
|
this.valuesList.$el.on('drop', _.bind(this.onDrop, this));
|
||||||
// this.valuesList.onKeyDown = _.bind(this.onValuesListKeyDown, this);
|
// this.valuesList.onKeyDown = _.bind(this.onValuesListKeyDown, this);
|
||||||
this.lockedControls.push(this.valuesList);
|
this.lockedControls.push(this.valuesList);
|
||||||
|
|
||||||
|
@ -172,6 +188,10 @@ define([
|
||||||
itemTemplate: itemTemplate
|
itemTemplate: itemTemplate
|
||||||
});
|
});
|
||||||
this.filtersList.on('item:click', _.bind(this.onColumnsSelect, this,3));
|
this.filtersList.on('item:click', _.bind(this.onColumnsSelect, this,3));
|
||||||
|
this.filtersList.$el.on('dragenter', _.bind(this.onDragEnter, this));
|
||||||
|
this.filtersList.$el.on('dragover', _.bind(this.onDragOver, this, this.filtersList));
|
||||||
|
this.filtersList.$el.on('dragleave', _.bind(this.onDragLeave, this, this.filtersList));
|
||||||
|
this.filtersList.$el.on('drop', _.bind(this.onDrop, this));
|
||||||
// this.filtersList.onKeyDown = _.bind(this.onFiltersListKeyDown, this);
|
// this.filtersList.onKeyDown = _.bind(this.onFiltersListKeyDown, this);
|
||||||
this.lockedControls.push(this.filtersList);
|
this.lockedControls.push(this.filtersList);
|
||||||
|
|
||||||
|
@ -180,6 +200,164 @@ define([
|
||||||
this._initSettings = false;
|
this._initSettings = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getDragElement: function(value) {
|
||||||
|
this._dragEl = $('<div style="font-weight: bold;position: absolute;left:-10000px;">' + value + '</div>');
|
||||||
|
$(document.body).append(this._dragEl);
|
||||||
|
return this._dragEl[0];
|
||||||
|
},
|
||||||
|
|
||||||
|
onDragEnd: function() {
|
||||||
|
this._dragEl && this._dragEl.remove();
|
||||||
|
this._dragEl = null;
|
||||||
|
},
|
||||||
|
|
||||||
|
onFieldsDragStart: function (item, index, event) {
|
||||||
|
event.originalEvent.dataTransfer.effectAllowed = 'move';
|
||||||
|
event.originalEvent.dataTransfer.setDragImage(this.getDragElement(item.model.get('value')), 14, 14);
|
||||||
|
this.pivotIndex = index;
|
||||||
|
this.fromListView = this.fieldsList.$el[0].id;
|
||||||
|
},
|
||||||
|
|
||||||
|
onItemsDragStart: function (listview, item, index, event) {
|
||||||
|
event.originalEvent.dataTransfer.effectAllowed = 'move';
|
||||||
|
event.originalEvent.dataTransfer.setDragImage(this.getDragElement(item.model.get('value')), 14, 14);
|
||||||
|
this.itemIndex = index;
|
||||||
|
this.pivotIndex = listview.store.at(index).attributes.pivotIndex;
|
||||||
|
this.fromListView = listview.$el[0].id;
|
||||||
|
},
|
||||||
|
|
||||||
|
onDragItemEnter: function (item, index, event) {
|
||||||
|
event.preventDefault();
|
||||||
|
item.$el.addClass('insert');
|
||||||
|
this.indexMoveTo = index;
|
||||||
|
},
|
||||||
|
|
||||||
|
onDragItemLeave: function (item, index, event) {
|
||||||
|
item.$el.removeClass('insert');
|
||||||
|
this.indexMoveTo = undefined;
|
||||||
|
},
|
||||||
|
|
||||||
|
onDragItemOver: function (listview, item, index, event) {
|
||||||
|
if (this.pivotIndex === -2 && (this.enterListView === 'pivot-list-filters' || this.enterListView === 'pivot-list-values')) {
|
||||||
|
event.originalEvent.dataTransfer.dropEffect = 'none';
|
||||||
|
} else {
|
||||||
|
event.preventDefault(); // Necessary. Allows us to drop.
|
||||||
|
event.originalEvent.dataTransfer.dropEffect = 'move';
|
||||||
|
item.$el.addClass('insert');
|
||||||
|
this.indexMoveTo = index;
|
||||||
|
|
||||||
|
// scroll
|
||||||
|
var heightListView = item.$el.parent().height(),
|
||||||
|
positionTopItem = item.$el.position().top,
|
||||||
|
heightItem = item.$el.outerHeight(),
|
||||||
|
scrollTop = item.$el.parent().scrollTop();
|
||||||
|
if (positionTopItem < heightItem && scrollTop > 0) {
|
||||||
|
listview.scrollToRecord(listview.store.at((index === 0) ? 0 : index - 1));
|
||||||
|
}
|
||||||
|
if (positionTopItem > heightListView - heightItem && index < listview.store.length) {
|
||||||
|
listview.scrollToRecord(listview.store.at((index === listview.store.length - 1) ? index : index + 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onDragEnter: function (event) {
|
||||||
|
this.enterListView = event.currentTarget.id;
|
||||||
|
},
|
||||||
|
|
||||||
|
onDragOver: function (listview, event) {
|
||||||
|
if ((this.pivotIndex === -2 && (this.enterListView === 'pivot-list-filters' || this.enterListView === 'pivot-list-values')) ||
|
||||||
|
(this.fromListView === 'pivot-list-fields' && this.enterListView === 'pivot-list-fields')) {
|
||||||
|
event.originalEvent.dataTransfer.dropEffect = 'none';
|
||||||
|
} else {
|
||||||
|
event.preventDefault(); // Necessary. Allows us to drop.
|
||||||
|
event.originalEvent.dataTransfer.dropEffect = 'move';
|
||||||
|
listview.$el.find('.item').last().addClass('insert last');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onDragLeave: function (listview, event) {
|
||||||
|
listview.$el.find('.item').removeClass('insert last');
|
||||||
|
},
|
||||||
|
|
||||||
|
onDrop: function (event) {
|
||||||
|
event.stopPropagation(); // Stops some browsers from redirecting.
|
||||||
|
this.onDragEnd();
|
||||||
|
if (this.fromListView === 'pivot-list-fields' && this.enterListView !== 'pivot-list-fields') { //insert field
|
||||||
|
if (_.isNumber(this.pivotIndex)) {
|
||||||
|
switch (this.enterListView) {
|
||||||
|
case 'pivot-list-columns':
|
||||||
|
this.onAddColumn(this.pivotIndex, this.indexMoveTo);
|
||||||
|
break;
|
||||||
|
case 'pivot-list-rows':
|
||||||
|
this.onAddRow(this.pivotIndex, this.indexMoveTo);
|
||||||
|
break;
|
||||||
|
case 'pivot-list-filters':
|
||||||
|
this.onAddFilter(this.pivotIndex, this.indexMoveTo);
|
||||||
|
break;
|
||||||
|
case 'pivot-list-values':
|
||||||
|
this.onAddValues(this.pivotIndex, this.indexMoveTo);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this.pivotIndex = undefined;
|
||||||
|
this.indexMoveTo = undefined;
|
||||||
|
}
|
||||||
|
} else if (this.enterListView === 'pivot-list-fields') { //remove field
|
||||||
|
if (_.isNumber(this.pivotIndex)) {
|
||||||
|
if (this.fromListView === 'pivot-list-values' && _.isNumber(this.itemIndex)) {
|
||||||
|
this.onRemove(this.pivotIndex, this.itemIndex);
|
||||||
|
} else {
|
||||||
|
this.onRemove(this.pivotIndex);
|
||||||
|
}
|
||||||
|
this.pivotIndex = undefined;
|
||||||
|
}
|
||||||
|
} else if (this.fromListView !== this.enterListView) { //move to
|
||||||
|
if (_.isNumber(this.itemIndex) && this.enterListView) {
|
||||||
|
switch (this.enterListView) {
|
||||||
|
case 'pivot-list-columns':
|
||||||
|
this.onMoveTo(0, this.pivotIndex, this.indexMoveTo);
|
||||||
|
break;
|
||||||
|
case 'pivot-list-rows':
|
||||||
|
this.onMoveTo(1, this.pivotIndex, this.indexMoveTo);
|
||||||
|
break;
|
||||||
|
case 'pivot-list-filters':
|
||||||
|
this.onMoveTo(3, this.pivotIndex, this.indexMoveTo);
|
||||||
|
break;
|
||||||
|
case 'pivot-list-values':
|
||||||
|
this.onMoveTo(2, this.pivotIndex, this.indexMoveTo);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this.itemIndex = undefined;
|
||||||
|
this.indexMoveTo = undefined;
|
||||||
|
}
|
||||||
|
} else if (this.fromListView === this.enterListView) { //move
|
||||||
|
if (_.isNumber(this.itemIndex) && this.enterListView) {
|
||||||
|
if (this.itemIndex !== this.indexMoveTo) {
|
||||||
|
switch (this.enterListView) {
|
||||||
|
case 'pivot-list-columns':
|
||||||
|
this.onMove(0, this.itemIndex, _.isNumber(this.indexMoveTo) ? (this.indexMoveTo !== 0 && this.itemIndex < this.indexMoveTo ? this.indexMoveTo - 1 : this.indexMoveTo) : this.columnsList.store.length - 1);
|
||||||
|
break;
|
||||||
|
case 'pivot-list-rows':
|
||||||
|
this.onMove(1, this.itemIndex, _.isNumber(this.indexMoveTo) ? (this.indexMoveTo !== 0 && this.itemIndex < this.indexMoveTo ? this.indexMoveTo - 1 : this.indexMoveTo) : this.rowsList.store.length - 1);
|
||||||
|
break;
|
||||||
|
case 'pivot-list-filters':
|
||||||
|
this.onMove(3, this.itemIndex, _.isNumber(this.indexMoveTo) ? (this.indexMoveTo !== 0 && this.itemIndex < this.indexMoveTo ? this.indexMoveTo - 1 : this.indexMoveTo) : this.filtersList.store.length - 1);
|
||||||
|
break;
|
||||||
|
case 'pivot-list-values':
|
||||||
|
this.onMove(2, this.itemIndex, _.isNumber(this.indexMoveTo) ? (this.indexMoveTo !== 0 && this.itemIndex < this.indexMoveTo ? this.indexMoveTo - 1 : this.indexMoveTo) : this.valuesList.store.length - 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$(this.el).find('.item').removeClass('insert last');
|
||||||
|
}
|
||||||
|
this.itemIndex = undefined;
|
||||||
|
this.indexMoveTo = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
openAdvancedSettings: function(e) {
|
openAdvancedSettings: function(e) {
|
||||||
if (this.linkAdvanced.hasClass('disabled')) return;
|
if (this.linkAdvanced.hasClass('disabled')) return;
|
||||||
|
|
||||||
|
@ -315,14 +493,60 @@ define([
|
||||||
});
|
});
|
||||||
this.fieldsList.store.reset(arr);
|
this.fieldsList.store.reset(arr);
|
||||||
this.fieldsList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true, suppressScrollX: true});
|
this.fieldsList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true, suppressScrollX: true});
|
||||||
|
|
||||||
|
this.fieldsList.dataViewItems.forEach(function (item, index) {
|
||||||
|
item.$el.attr('draggable', true);
|
||||||
|
item.$el.on('dragstart', _.bind(me.onFieldsDragStart, me, item, index));
|
||||||
|
item.$el.on('dragend', _.bind(me.onDragEnd, me));
|
||||||
|
});
|
||||||
|
this.columnsList.dataViewItems.forEach(function (item, index) {
|
||||||
|
item.$el.attr('draggable', true);
|
||||||
|
item.$el.on('dragstart', _.bind(me.onItemsDragStart, me, me.columnsList, item, index));
|
||||||
|
item.$el.on('dragenter', _.bind(me.onDragItemEnter, me, item, index));
|
||||||
|
item.$el.on('dragleave', _.bind(me.onDragItemLeave, me, item, index));
|
||||||
|
item.$el.on('dragover', _.bind(me.onDragItemOver, me, me.columnsList, item, index));
|
||||||
|
item.$el.on('drop', _.bind(me.onDrop, me));
|
||||||
|
item.$el.on('dragend', _.bind(me.onDragEnd, me));
|
||||||
|
});
|
||||||
|
this.columnsList.$el.find('.item').last().css({'margin-bottom': '10px'});
|
||||||
|
this.rowsList.dataViewItems.forEach(function (item, index) {
|
||||||
|
item.$el.attr('draggable', true);
|
||||||
|
item.$el.on('dragstart', _.bind(me.onItemsDragStart, me, me.rowsList, item, index));
|
||||||
|
item.$el.on('dragenter', _.bind(me.onDragItemEnter, me, item, index));
|
||||||
|
item.$el.on('dragleave', _.bind(me.onDragItemLeave, me, item, index));
|
||||||
|
item.$el.on('dragover', _.bind(me.onDragItemOver, me, me.rowsList, item, index));
|
||||||
|
item.$el.on('drop', _.bind(me.onDrop, me));
|
||||||
|
item.$el.on('dragend', _.bind(me.onDragEnd, me));
|
||||||
|
});
|
||||||
|
this.rowsList.$el.find('.item').last().css({'margin-bottom': '10px'});
|
||||||
|
this.valuesList.dataViewItems.forEach(function (item, index) {
|
||||||
|
item.$el.attr('draggable', true);
|
||||||
|
item.$el.on('dragstart', _.bind(me.onItemsDragStart, me, me.valuesList, item, index));
|
||||||
|
item.$el.on('dragenter', _.bind(me.onDragItemEnter, me, item, index));
|
||||||
|
item.$el.on('dragleave', _.bind(me.onDragItemLeave, me, item, index));
|
||||||
|
item.$el.on('dragover', _.bind(me.onDragItemOver, me, me.valuesList, item, index));
|
||||||
|
item.$el.on('drop', _.bind(me.onDrop, me));
|
||||||
|
item.$el.on('dragend', _.bind(me.onDragEnd, me));
|
||||||
|
});
|
||||||
|
this.valuesList.$el.find('.item').last().css({'margin-bottom': '10px'});
|
||||||
|
this.filtersList.dataViewItems.forEach(function (item, index) {
|
||||||
|
item.$el.attr('draggable', true);
|
||||||
|
item.$el.on('dragstart', _.bind(me.onItemsDragStart, me, me.filtersList, item, index));
|
||||||
|
item.$el.on('dragenter', _.bind(me.onDragItemEnter, me, item, index));
|
||||||
|
item.$el.on('dragleave', _.bind(me.onDragItemLeave, me, item, index));
|
||||||
|
item.$el.on('dragover', _.bind(me.onDragItemOver, me, me.filtersList, item, index));
|
||||||
|
item.$el.on('drop', _.bind(me.onDrop, me));
|
||||||
|
item.$el.on('dragend', _.bind(me.onDragEnd, me));
|
||||||
|
});
|
||||||
|
this.filtersList.$el.find('.item').last().css({'margin-bottom': '10px'});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onFieldsCheck: function (listView, itemView, record) {
|
onFieldsCheck: function (listView, itemView, record) {
|
||||||
if (this.checkCellTrigerBlock)
|
// if (this.checkCellTrigerBlock)
|
||||||
return;
|
// return;
|
||||||
|
|
||||||
var target = '', type = '', isLabel = false, bound = null;
|
var target = '', isLabel = false, bound = null;
|
||||||
|
|
||||||
var event = window.event ? window.event : window._event;
|
var event = window.event ? window.event : window._event;
|
||||||
if (event) {
|
if (event) {
|
||||||
|
@ -345,17 +569,17 @@ define([
|
||||||
caption : this.txtAddRow,
|
caption : this.txtAddRow,
|
||||||
checkable : false
|
checkable : false
|
||||||
});
|
});
|
||||||
// this.miAddRow.on('click', _.bind(this.onAddRow, this));
|
this.miAddRow.on('click', _.bind(this.onAddRow, this));
|
||||||
this.miAddColumn = new Common.UI.MenuItem({
|
this.miAddColumn = new Common.UI.MenuItem({
|
||||||
caption : this.txtAddColumn,
|
caption : this.txtAddColumn,
|
||||||
checkable : false
|
checkable : false
|
||||||
});
|
});
|
||||||
// this.miAddColumn.on('click', _.bind(this.onAddColumn, this));
|
this.miAddColumn.on('click', _.bind(this.onAddColumn, this));
|
||||||
this.miAddValues = new Common.UI.MenuItem({
|
this.miAddValues = new Common.UI.MenuItem({
|
||||||
caption : this.txtAddValues,
|
caption : this.txtAddValues,
|
||||||
checkable : false
|
checkable : false
|
||||||
});
|
});
|
||||||
// this.miAddValues.on('click', _.bind(this.onAddValues, this));
|
this.miAddValues.on('click', _.bind(this.onAddValues, this));
|
||||||
|
|
||||||
this.pivotFieldsMenu = new Common.UI.Menu({
|
this.pivotFieldsMenu = new Common.UI.Menu({
|
||||||
menuAlign: 'tr-br',
|
menuAlign: 'tr-br',
|
||||||
|
@ -408,7 +632,6 @@ define([
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
type = event.target.type;
|
|
||||||
target = $(event.currentTarget).find('.list-item');
|
target = $(event.currentTarget).find('.list-item');
|
||||||
|
|
||||||
if (target.length) {
|
if (target.length) {
|
||||||
|
@ -421,7 +644,7 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'button' || isLabel) {
|
if (isLabel || event.target.className.match('checkbox')) {
|
||||||
this.updateFieldCheck(listView, record);
|
this.updateFieldCheck(listView, record);
|
||||||
|
|
||||||
_.delay(function () {
|
_.delay(function () {
|
||||||
|
@ -433,11 +656,18 @@ define([
|
||||||
|
|
||||||
updateFieldCheck: function (listView, record) {
|
updateFieldCheck: function (listView, record) {
|
||||||
if (record && listView) {
|
if (record && listView) {
|
||||||
listView.isSuspendEvents = true;
|
// listView.isSuspendEvents = true;
|
||||||
|
|
||||||
record.set('check', !record.get('check'));
|
record.set('check', !record.get('check'));
|
||||||
|
if (this.api && !this._locked){
|
||||||
|
if (record.get('check')) {
|
||||||
|
this._originalProps.asc_addField(this.api, record.get('index'));
|
||||||
|
} else {
|
||||||
|
this._originalProps.asc_removeField(this.api, record.get('index'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
listView.isSuspendEvents = false;
|
// listView.isSuspendEvents = false;
|
||||||
listView.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true, suppressScrollX: true});
|
listView.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true, suppressScrollX: true});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -445,7 +675,7 @@ define([
|
||||||
onColumnsSelect: function(type, picker, item, record, e){
|
onColumnsSelect: function(type, picker, item, record, e){
|
||||||
var btn = $(e.target);
|
var btn = $(e.target);
|
||||||
if (btn && btn.hasClass('listitem-icon')) {
|
if (btn && btn.hasClass('listitem-icon')) {
|
||||||
this._state.field = {record: record, type: type};
|
this._state.field = {record: record, type: type, length: picker.store.length};
|
||||||
if (this.fieldsMenu) {
|
if (this.fieldsMenu) {
|
||||||
if (this.fieldsMenu.isVisible()) {
|
if (this.fieldsMenu.isVisible()) {
|
||||||
this.fieldsMenu.hide();
|
this.fieldsMenu.hide();
|
||||||
|
@ -456,43 +686,43 @@ define([
|
||||||
caption : this.txtMoveUp,
|
caption : this.txtMoveUp,
|
||||||
checkable : false
|
checkable : false
|
||||||
});
|
});
|
||||||
// this.miMoveUp.on('click', _.bind(this.onMoveUp, this));
|
this.miMoveUp.on('click', _.bind(this.onMoveUp, this));
|
||||||
this.miMoveDown = new Common.UI.MenuItem({
|
this.miMoveDown = new Common.UI.MenuItem({
|
||||||
caption : this.txtMoveDown,
|
caption : this.txtMoveDown,
|
||||||
checkable : false
|
checkable : false
|
||||||
});
|
});
|
||||||
// this.miMoveDown.on('click', _.bind(this.onMoveDown, this));
|
this.miMoveDown.on('click', _.bind(this.onMoveDown, this));
|
||||||
this.miMoveBegin = new Common.UI.MenuItem({
|
this.miMoveBegin = new Common.UI.MenuItem({
|
||||||
caption : this.txtMoveBegin,
|
caption : this.txtMoveBegin,
|
||||||
checkable : false
|
checkable : false
|
||||||
});
|
});
|
||||||
// this.miMoveBegin.on('click', _.bind(this.onMoveBegin, this));
|
this.miMoveBegin.on('click', _.bind(this.onMoveBegin, this));
|
||||||
this.miMoveEnd = new Common.UI.MenuItem({
|
this.miMoveEnd = new Common.UI.MenuItem({
|
||||||
caption : this.txtMoveEnd,
|
caption : this.txtMoveEnd,
|
||||||
checkable : false
|
checkable : false
|
||||||
});
|
});
|
||||||
// this.miMoveEnd.on('click', _.bind(this.onMoveEnd, this));
|
this.miMoveEnd.on('click', _.bind(this.onMoveEnd, this));
|
||||||
|
|
||||||
this.miMoveFilter = new Common.UI.MenuItem({
|
this.miMoveFilter = new Common.UI.MenuItem({
|
||||||
caption : this.txtMoveFilter,
|
caption : this.txtMoveFilter,
|
||||||
checkable : false
|
checkable : false
|
||||||
});
|
});
|
||||||
// this.miMoveFilter.on('click', _.bind(this.onMoveFilter, this));
|
this.miMoveFilter.on('click', _.bind(this.onMoveTo, this, 3));
|
||||||
this.miMoveRow = new Common.UI.MenuItem({
|
this.miMoveRow = new Common.UI.MenuItem({
|
||||||
caption : this.txtMoveRow,
|
caption : this.txtMoveRow,
|
||||||
checkable : false
|
checkable : false
|
||||||
});
|
});
|
||||||
// this.miMoveRow.on('click', _.bind(this.onMoveRow, this));
|
this.miMoveRow.on('click', _.bind(this.onMoveTo, this, 1));
|
||||||
this.miMoveColumn = new Common.UI.MenuItem({
|
this.miMoveColumn = new Common.UI.MenuItem({
|
||||||
caption : this.txtMoveColumn,
|
caption : this.txtMoveColumn,
|
||||||
checkable : false
|
checkable : false
|
||||||
});
|
});
|
||||||
// this.miMoveColumn.on('click', _.bind(this.onMoveColumn, this));
|
this.miMoveColumn.on('click', _.bind(this.onMoveTo, this, 0));
|
||||||
this.miMoveValues = new Common.UI.MenuItem({
|
this.miMoveValues = new Common.UI.MenuItem({
|
||||||
caption : this.txtMoveValues,
|
caption : this.txtMoveValues,
|
||||||
checkable : false
|
checkable : false
|
||||||
});
|
});
|
||||||
// this.miMoveValues.on('click', _.bind(this.onMoveValues, this));
|
this.miMoveValues.on('click', _.bind(this.onMoveTo, this, 2));
|
||||||
|
|
||||||
this.miRemove = new Common.UI.MenuItem({
|
this.miRemove = new Common.UI.MenuItem({
|
||||||
caption : this.txtRemove,
|
caption : this.txtRemove,
|
||||||
|
@ -526,19 +756,21 @@ define([
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.miMoveFilter.setDisabled(type == 3); // menu for filter
|
|
||||||
this.miMoveRow.setDisabled(type == 1); // menu for row
|
|
||||||
this.miMoveColumn.setDisabled(type == 0); // menu for column
|
|
||||||
this.miMoveValues.setDisabled(type == 2); // menu for value
|
|
||||||
|
|
||||||
var recIndex = (record != undefined) ? record.get('index') : -1,
|
var recIndex = (record != undefined) ? record.get('index') : -1,
|
||||||
len = picker.store.length;
|
len = picker.store.length,
|
||||||
|
pivotIndex = record.get('pivotIndex');
|
||||||
this.miMoveUp.setDisabled(recIndex<1);
|
this.miMoveUp.setDisabled(recIndex<1);
|
||||||
this.miMoveDown.setDisabled(recIndex>len-2 || recIndex<0);
|
this.miMoveDown.setDisabled(recIndex>len-2 || recIndex<0);
|
||||||
this.miMoveBegin.setDisabled(recIndex<1);
|
this.miMoveBegin.setDisabled(recIndex<1);
|
||||||
this.miMoveEnd.setDisabled(recIndex>len-2 || recIndex<0);
|
this.miMoveEnd.setDisabled(recIndex>len-2 || recIndex<0);
|
||||||
|
|
||||||
this.miFieldSettings.setDisabled(record.get('pivotIndex')==-2);
|
this.miMoveFilter.setDisabled(type == 3 || pivotIndex==-2); // menu for filter
|
||||||
|
this.miMoveRow.setDisabled(type == 1); // menu for row
|
||||||
|
this.miMoveColumn.setDisabled(type == 0); // menu for column
|
||||||
|
this.miMoveValues.setDisabled(type == 2 || pivotIndex==-2); // menu for value
|
||||||
|
|
||||||
|
this.miFieldSettings.setDisabled(pivotIndex==-2);
|
||||||
|
|
||||||
var menu = this.fieldsMenu,
|
var menu = this.fieldsMenu,
|
||||||
showPoint, me = this,
|
showPoint, me = this,
|
||||||
|
@ -587,7 +819,8 @@ define([
|
||||||
var win;
|
var win;
|
||||||
if (me.api && !this._locked && me._state.field){
|
if (me.api && !this._locked && me._state.field){
|
||||||
if (me._state.field.type == 2) { // value field
|
if (me._state.field.type == 2) { // value field
|
||||||
var field = me._originalProps.asc_getDataFields()[me._state.field.record.get('index')];
|
var dataIndex = me._state.field.record.get('index');
|
||||||
|
var field = me._originalProps.asc_getDataFields()[dataIndex];
|
||||||
(new SSE.Views.ValueFieldSettingsDialog(
|
(new SSE.Views.ValueFieldSettingsDialog(
|
||||||
{
|
{
|
||||||
props: me._originalProps,
|
props: me._originalProps,
|
||||||
|
@ -596,23 +829,25 @@ define([
|
||||||
api: me.api,
|
api: me.api,
|
||||||
handler: function(result, value) {
|
handler: function(result, value) {
|
||||||
if (result == 'ok' && me.api && value) {
|
if (result == 'ok' && me.api && value) {
|
||||||
field.asc_set(me.api, me._originalProps, value);
|
field.asc_set(me.api, me._originalProps, dataIndex, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Common.NotificationCenter.trigger('edit:complete', me);
|
Common.NotificationCenter.trigger('edit:complete', me);
|
||||||
}
|
}
|
||||||
})).show();
|
})).show();
|
||||||
} else {
|
} else {
|
||||||
|
var pivotIndex = me._state.field.record.get('pivotIndex');
|
||||||
|
var pivotField = me._originalProps.asc_getPivotFields()[pivotIndex];
|
||||||
(new SSE.Views.FieldSettingsDialog(
|
(new SSE.Views.FieldSettingsDialog(
|
||||||
{
|
{
|
||||||
props: me._originalProps,
|
props: me._originalProps,
|
||||||
fieldIndex: me._state.field.record.get('pivotIndex'),
|
fieldIndex: pivotIndex,
|
||||||
names: me._state.names,
|
names: me._state.names,
|
||||||
api: me.api,
|
api: me.api,
|
||||||
type: me._state.field.type,
|
type: me._state.field.type,
|
||||||
handler: function(result, value) {
|
handler: function(result, value) {
|
||||||
if (result == 'ok' && me.api && value) {
|
if (result == 'ok' && me.api && value) {
|
||||||
// me.api.asc_changeFormatTableInfo(me._state.TableName, Asc.c_oAscChangeTableStyleInfo.advancedSettings, value);
|
pivotField.asc_set(me.api, me._originalProps, pivotIndex, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Common.NotificationCenter.trigger('edit:complete', me);
|
Common.NotificationCenter.trigger('edit:complete', me);
|
||||||
|
@ -622,15 +857,102 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onAddFilter: function() {
|
onAddFilter: function(index, moveTo) {
|
||||||
if (this.api && !this._locked && this._state.field){
|
if (this.api && !this._locked && this._state.field){
|
||||||
this._originalProps.asc_addPageField(this.api, this._state.field.record.get('index'));
|
this._originalProps.asc_addPageField(this.api, _.isNumber(index) ? index : this._state.field.record.get('index'), _.isNumber(moveTo) ? moveTo : undefined);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onRemove: function() {
|
onAddRow: function(index, moveTo) {
|
||||||
if (this.api && !this._locked && this._state.field){
|
if (this.api && !this._locked && this._state.field){
|
||||||
this._originalProps.asc_removeField(this.api, this._state.field.record.get('pivotIndex'));
|
this._originalProps.asc_addRowField(this.api, _.isNumber(index) ? index : this._state.field.record.get('index'), _.isNumber(moveTo) ? moveTo : undefined);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onAddColumn: function(index, moveTo) {
|
||||||
|
if (this.api && !this._locked && this._state.field){
|
||||||
|
this._originalProps.asc_addColField(this.api, _.isNumber(index) ? index : this._state.field.record.get('index'), _.isNumber(moveTo) ? moveTo : undefined);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onAddValues: function(index, moveTo) {
|
||||||
|
if (this.api && !this._locked && this._state.field){
|
||||||
|
this._originalProps.asc_addDataField(this.api, _.isNumber(index) ? index : this._state.field.record.get('index'), _.isNumber(moveTo) ? moveTo : undefined);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onRemove: function(pivotindex, index) {
|
||||||
|
if (this.api && !this._locked && this._state.field){
|
||||||
|
if (this._state.field.type==2 || _.isNumber(index)) // value
|
||||||
|
this._originalProps.asc_removeDataField(this.api, _.isNumber(pivotindex) ? pivotindex : this._state.field.record.get('pivotIndex'), _.isNumber(index) ? index : this._state.field.record.get('index'));
|
||||||
|
else
|
||||||
|
this._originalProps.asc_removeNoDataField(this.api, _.isNumber(pivotindex) ? pivotindex : this._state.field.record.get('pivotIndex'));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onMoveUp: function() {
|
||||||
|
if (this.api && !this._locked && this._state.field){
|
||||||
|
var index = this._state.field.record.get('index');
|
||||||
|
this.onMove(this._state.field.type, index, index-1);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onMoveDown: function() {
|
||||||
|
if (this.api && !this._locked && this._state.field){
|
||||||
|
var index = this._state.field.record.get('index');
|
||||||
|
this.onMove(this._state.field.type, index, index+1);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onMoveBegin: function() {
|
||||||
|
if (this.api && !this._locked && this._state.field){
|
||||||
|
var index = this._state.field.record.get('index');
|
||||||
|
this.onMove(this._state.field.type, index, 0);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onMoveEnd: function() {
|
||||||
|
if (this.api && !this._locked && this._state.field){
|
||||||
|
var index = this._state.field.record.get('index');
|
||||||
|
this.onMove(this._state.field.type, index, this._state.field.length-1);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onMove: function(type, from, to) {
|
||||||
|
switch (type) {
|
||||||
|
case 0:
|
||||||
|
this._originalProps.asc_moveColField(this.api, from, to);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
this._originalProps.asc_moveRowField(this.api, from, to);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
this._originalProps.asc_moveDataField(this.api, from, to);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
this._originalProps.asc_movePageField(this.api, from, to);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onMoveTo: function(type, pivotindex, to) {
|
||||||
|
if (this.api && !this._locked && this._state.field){
|
||||||
|
var pivotIndex = _.isNumber(pivotindex) ? pivotindex : this._state.field.record.get('pivotIndex'),
|
||||||
|
index = _.isNumber(to) ? to : ((this._state.field.type==2) ? this._state.field.record.get('index') : undefined);
|
||||||
|
switch (type) {
|
||||||
|
case 0:
|
||||||
|
this._originalProps.asc_moveToColField(this.api, pivotIndex, index);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
this._originalProps.asc_moveToRowField(this.api, pivotIndex, index);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
this._originalProps.asc_moveToDataField(this.api, pivotIndex, index);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
this._originalProps.asc_moveToPageField(this.api, pivotIndex, index);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -646,12 +968,18 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onItemChanged: function (view, record) {
|
||||||
|
var state = record.model.get('check');
|
||||||
|
if ( state == 'indeterminate' )
|
||||||
|
$('input[type=checkbox]', record.$el).prop('indeterminate', true);
|
||||||
|
else $('input[type=checkbox]', record.$el).prop({checked: state, indeterminate: false});
|
||||||
|
},
|
||||||
|
|
||||||
textFields: 'Select Fields',
|
textFields: 'Select Fields',
|
||||||
textValues : 'Values',
|
textValues : 'Values',
|
||||||
textRows : 'Rows',
|
textRows : 'Rows',
|
||||||
textColumns : 'Columns',
|
textColumns : 'Columns',
|
||||||
textFilters : 'Filters',
|
textFilters : 'Filters',
|
||||||
notcriticalErrorTitle : 'Warning',
|
|
||||||
textAdvanced: 'Show advanced settings',
|
textAdvanced: 'Show advanced settings',
|
||||||
txtMoveUp: 'Move Up',
|
txtMoveUp: 'Move Up',
|
||||||
txtMoveDown: 'Move Down',
|
txtMoveDown: 'Move Down',
|
||||||
|
|
|
@ -72,9 +72,17 @@ define([ 'text!spreadsheeteditor/main/app/template/PivotSettingsAdvanced.temp
|
||||||
}, options);
|
}, options);
|
||||||
|
|
||||||
this.api = options.api;
|
this.api = options.api;
|
||||||
this.handler = options.handler;
|
|
||||||
this.props = options.props;
|
this.props = options.props;
|
||||||
|
|
||||||
|
this.options.handler = function(result, value) {
|
||||||
|
if ( result != 'ok' || this.isRangeValid() ) {
|
||||||
|
if (options.handler)
|
||||||
|
options.handler.call(this, result, value);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
|
Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -203,56 +211,60 @@ define([ 'text!spreadsheeteditor/main/app/template/PivotSettingsAdvanced.temp
|
||||||
|
|
||||||
this.chHeaders.setValue(props.asc_getShowHeaders(), true);
|
this.chHeaders.setValue(props.asc_getShowHeaders(), true);
|
||||||
|
|
||||||
// var value = props.getRange();
|
var value = props.asc_getDataRef();
|
||||||
// this.txtDataRange.setValue((value) ? value : '');
|
this.txtDataRange.setValue((value) ? value : '');
|
||||||
// this.dataRangeValid = value;
|
this.dataRangeValid = value;
|
||||||
|
|
||||||
this.txtDataRange.validation = function(value) {
|
this.txtDataRange.validation = function(value) {
|
||||||
// var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Pivot, value, false);
|
var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PivotTableData, value, false);
|
||||||
// return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true;
|
return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true;
|
||||||
return true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
value = props.asc_getTitle();
|
||||||
|
this.inputAltTitle.setValue(value ? value : '');
|
||||||
|
|
||||||
|
value = props.asc_getDescription();
|
||||||
|
this.textareaAltDescription.val(value ? value : '');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getSettings: function () {
|
getSettings: function () {
|
||||||
var props = new Asc.CT_pivotTableDefinition();
|
var props = new Asc.CT_pivotTableDefinition();
|
||||||
|
props.asc_setName(this.inputName.getValue());
|
||||||
props.asc_setRowGrandTotals(this.chCols.getValue() == 'checked');
|
props.asc_setRowGrandTotals(this.chCols.getValue() == 'checked');
|
||||||
props.asc_setColGrandTotals(this.chRows.getValue() == 'checked');
|
props.asc_setColGrandTotals(this.chRows.getValue() == 'checked');
|
||||||
|
props.asc_setPageOverThenDown(this.radioOver.getValue());
|
||||||
|
props.asc_setPageWrap(this.numWrap.getNumberValue());
|
||||||
|
props.asc_setShowHeaders(this.chHeaders.getValue() == 'checked');
|
||||||
|
props.asc_setDataRef(this.txtDataRange.getValue());
|
||||||
|
|
||||||
|
if (this.isAltTitleChanged)
|
||||||
|
props.asc_setTitle(this.inputAltTitle.getValue());
|
||||||
|
if (this.isAltDescChanged)
|
||||||
|
props.asc_setDescription(this.textareaAltDescription.val());
|
||||||
|
|
||||||
return props;
|
return props;
|
||||||
},
|
},
|
||||||
|
|
||||||
onDlgBtnClick: function(event) {
|
|
||||||
var me = this;
|
|
||||||
var state = (typeof(event) == 'object') ? event.currentTarget.attributes['result'].value : event;
|
|
||||||
if (state == 'ok' && this.isRangeValid()) {
|
|
||||||
this.handler && this.handler.call(this, state, (state == 'ok') ? this.getSettings() : undefined);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.close();
|
|
||||||
},
|
|
||||||
|
|
||||||
onPrimary: function() {
|
|
||||||
this.onDlgBtnClick('ok');
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
|
|
||||||
isRangeValid: function() {
|
isRangeValid: function() {
|
||||||
if (this.isChart) {
|
var isvalid = true,
|
||||||
var isvalid;
|
txtError = '';
|
||||||
if (!_.isEmpty(this.txtDataRange.getValue())) {
|
|
||||||
isvalid = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Pivot, this.txtDataRange.getValue());
|
|
||||||
if (isvalid == Asc.c_oAscError.ID.No)
|
|
||||||
return true;
|
|
||||||
} else
|
|
||||||
this.txtDataRange.showError([this.txtEmpty]);
|
|
||||||
|
|
||||||
|
if (_.isEmpty(this.txtDataRange.getValue())) {
|
||||||
|
isvalid = false;
|
||||||
|
txtError = this.txtEmpty;
|
||||||
|
} else {
|
||||||
|
isvalid = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PivotTableData, this.txtDataRange.getValue());
|
||||||
|
isvalid = (isvalid == Asc.c_oAscError.ID.No);
|
||||||
|
!isvalid && (txtError = this.textInvalidRange);
|
||||||
|
}
|
||||||
|
if (!isvalid) {
|
||||||
this.setActiveCategory(1);
|
this.setActiveCategory(1);
|
||||||
|
this.txtDataRange.showError([txtError]);
|
||||||
this.txtDataRange.cmpEl.find('input').focus();
|
this.txtDataRange.cmpEl.find('input').focus();
|
||||||
return false;
|
return isvalid;
|
||||||
} else
|
}
|
||||||
return true;
|
return isvalid;
|
||||||
},
|
},
|
||||||
|
|
||||||
onSelectData: function() {
|
onSelectData: function() {
|
||||||
|
@ -278,7 +290,7 @@ define([ 'text!spreadsheeteditor/main/app/template/PivotSettingsAdvanced.temp
|
||||||
win.setSettings({
|
win.setSettings({
|
||||||
api : me.api,
|
api : me.api,
|
||||||
range : (!_.isEmpty(me.txtDataRange.getValue()) && (me.txtDataRange.checkValidate()==true)) ? me.txtDataRange.getValue() : me.dataRangeValid,
|
range : (!_.isEmpty(me.txtDataRange.getValue()) && (me.txtDataRange.checkValidate()==true)) ? me.txtDataRange.getValue() : me.dataRangeValid,
|
||||||
type : Asc.c_oAscSelectionDialogType.Pivot
|
type : Asc.c_oAscSelectionDialogType.PivotTableData
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -52,21 +52,21 @@ define([
|
||||||
SSE.Views.PivotTable = Common.UI.BaseView.extend(_.extend((function(){
|
SSE.Views.PivotTable = Common.UI.BaseView.extend(_.extend((function(){
|
||||||
var template =
|
var template =
|
||||||
'<section id="pivot-table-panel" class="panel" data-tab="pivot">' +
|
'<section id="pivot-table-panel" class="panel" data-tab="pivot">' +
|
||||||
// '<div class="group">' +
|
'<div class="group">' +
|
||||||
// '<span id="slot-btn-add-pivot" class="btn-slot text x-huge"></span>' +
|
'<span id="slot-btn-add-pivot" class="btn-slot text x-huge"></span>' +
|
||||||
// '</div>' +
|
'</div>' +
|
||||||
// '<div class="separator long"/>' +
|
'<div class="separator long"/>' +
|
||||||
// '<div class="group">' +
|
'<div class="group">' +
|
||||||
// '<span id="slot-btn-pivot-report-layout" class="btn-slot text x-huge"></span>' +
|
'<span id="slot-btn-pivot-report-layout" class="btn-slot text x-huge"></span>' +
|
||||||
// '<span id="slot-btn-pivot-blank-rows" class="btn-slot text x-huge"></span>' +
|
'<span id="slot-btn-pivot-blank-rows" class="btn-slot text x-huge"></span>' +
|
||||||
// '<span id="slot-btn-pivot-subtotals" class="btn-slot text x-huge"></span>' +
|
'<span id="slot-btn-pivot-subtotals" class="btn-slot text x-huge"></span>' +
|
||||||
// '<span id="slot-btn-pivot-grand-totals" class="btn-slot text x-huge"></span>' +
|
'<span id="slot-btn-pivot-grand-totals" class="btn-slot text x-huge"></span>' +
|
||||||
// '</div>' +
|
'</div>' +
|
||||||
// '<div class="separator long"/>' +
|
'<div class="separator long"/>' +
|
||||||
// '<div class="group">' +
|
'<div class="group">' +
|
||||||
// '<span id="slot-btn-refresh-pivot" class="btn-slot text x-huge"></span>' +
|
'<span id="slot-btn-refresh-pivot" class="btn-slot text x-huge"></span>' +
|
||||||
// '</div>' +
|
'</div>' +
|
||||||
// '<div class="separator long"/>' +
|
'<div class="separator long"/>' +
|
||||||
'<div class="group">' +
|
'<div class="group">' +
|
||||||
'<span id="slot-btn-select-pivot" class="btn-slot text x-huge"></span>' +
|
'<span id="slot-btn-select-pivot" class="btn-slot text x-huge"></span>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
|
@ -152,109 +152,94 @@ define([
|
||||||
this.appConfig = options.mode;
|
this.appConfig = options.mode;
|
||||||
this.lockedControls = [];
|
this.lockedControls = [];
|
||||||
|
|
||||||
|
var _set = SSE.enumLock;
|
||||||
|
|
||||||
this.chRowHeader = new Common.UI.CheckBox({
|
this.chRowHeader = new Common.UI.CheckBox({
|
||||||
labelText: this.textRowHeader
|
labelText: this.textRowHeader,
|
||||||
|
lock : [_set.lostConnect, _set.coAuth, _set.noPivot]
|
||||||
});
|
});
|
||||||
this.lockedControls.push(this.chRowHeader);
|
this.lockedControls.push(this.chRowHeader);
|
||||||
|
|
||||||
this.chColHeader = new Common.UI.CheckBox({
|
this.chColHeader = new Common.UI.CheckBox({
|
||||||
labelText: this.textColHeader
|
labelText: this.textColHeader,
|
||||||
|
lock : [_set.lostConnect, _set.coAuth, _set.noPivot]
|
||||||
});
|
});
|
||||||
this.lockedControls.push(this.chColHeader);
|
this.lockedControls.push(this.chColHeader);
|
||||||
|
|
||||||
this.chRowBanded = new Common.UI.CheckBox({
|
this.chRowBanded = new Common.UI.CheckBox({
|
||||||
labelText: this.textRowBanded
|
labelText: this.textRowBanded,
|
||||||
|
lock : [_set.lostConnect, _set.coAuth, _set.noPivot]
|
||||||
});
|
});
|
||||||
this.lockedControls.push(this.chRowBanded);
|
this.lockedControls.push(this.chRowBanded);
|
||||||
|
|
||||||
this.chColBanded = new Common.UI.CheckBox({
|
this.chColBanded = new Common.UI.CheckBox({
|
||||||
labelText: this.textColBanded
|
labelText: this.textColBanded,
|
||||||
|
lock : [_set.lostConnect, _set.coAuth, _set.noPivot]
|
||||||
});
|
});
|
||||||
this.lockedControls.push(this.chColBanded);
|
this.lockedControls.push(this.chColBanded);
|
||||||
|
|
||||||
this.btnAddPivot = new Common.UI.Button({
|
this.btnAddPivot = new Common.UI.Button({
|
||||||
cls: 'btn-toolbar x-huge icon-top',
|
cls: 'btn-toolbar x-huge icon-top',
|
||||||
iconCls: 'btn-add-pivot',
|
iconCls: 'toolbar__icon btn-add-pivot',
|
||||||
caption: this.txtCreate,
|
caption: this.txtCreate,
|
||||||
disabled : true
|
disabled : false,
|
||||||
|
lock : [_set.lostConnect, _set.coAuth, _set.editPivot]
|
||||||
});
|
});
|
||||||
// this.lockedControls.push(this.btnAddPivot);
|
|
||||||
|
|
||||||
this.btnPivotLayout = new Common.UI.Button({
|
this.btnPivotLayout = new Common.UI.Button({
|
||||||
cls : 'btn-toolbar x-huge icon-top',
|
cls : 'btn-toolbar x-huge icon-top',
|
||||||
iconCls : 'btn-pivot-layout',
|
iconCls : 'toolbar__icon btn-pivot-layout',
|
||||||
caption : this.capLayout,
|
caption : this.capLayout,
|
||||||
disabled : true,
|
disabled : true,
|
||||||
menu : new Common.UI.Menu({
|
lock : [_set.lostConnect, _set.coAuth, _set.noPivot],
|
||||||
items: [
|
menu : true
|
||||||
{ caption: this.mniLayoutCompact, value: 0 },
|
|
||||||
{ caption: this.mniLayoutOutline, value: 1 },
|
|
||||||
{ caption: this.mniLayoutTabular, value: 2 },
|
|
||||||
{ caption: '--' },
|
|
||||||
{ caption: this.mniLayoutRepeat, value: 3 },
|
|
||||||
{ caption: this.mniLayoutNoRepeat, value: 4 }
|
|
||||||
]
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
// this.lockedControls.push(this.btnPivotLayout); // remove commentings after enabled option
|
this.lockedControls.push(this.btnPivotLayout);
|
||||||
|
|
||||||
this.btnPivotBlankRows = new Common.UI.Button({
|
this.btnPivotBlankRows = new Common.UI.Button({
|
||||||
cls : 'btn-toolbar x-huge icon-top',
|
cls : 'btn-toolbar x-huge icon-top',
|
||||||
iconCls : 'btn-blank-rows',
|
iconCls : 'toolbar__icon btn-blank-rows',
|
||||||
caption : this.capBlankRows,
|
caption : this.capBlankRows,
|
||||||
disabled : true,
|
disabled : true,
|
||||||
menu : new Common.UI.Menu({
|
lock : [_set.lostConnect, _set.coAuth, _set.noPivot],
|
||||||
items: [
|
menu : true
|
||||||
{ caption: this.mniInsertBlankLine, value: 'insert' },
|
|
||||||
{ caption: this.mniRemoveBlankLine, value: 'remove' }
|
|
||||||
]
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
// this.lockedControls.push(this.btnPivotBlankRows); // remove commentings after enabled option
|
this.lockedControls.push(this.btnPivotBlankRows);
|
||||||
|
|
||||||
this.btnPivotSubtotals = new Common.UI.Button({
|
this.btnPivotSubtotals = new Common.UI.Button({
|
||||||
cls : 'btn-toolbar x-huge icon-top',
|
cls : 'btn-toolbar x-huge icon-top',
|
||||||
iconCls : 'btn-subtotals',
|
iconCls : 'toolbar__icon btn-subtotals',
|
||||||
caption : this.capSubtotals,
|
caption : this.capSubtotals,
|
||||||
disabled : true,
|
disabled : true,
|
||||||
menu : new Common.UI.Menu({
|
lock : [_set.lostConnect, _set.coAuth, _set.noPivot],
|
||||||
items: [
|
menu : true
|
||||||
{ caption: this.mniNoSubtotals, value: 0 },
|
|
||||||
{ caption: this.mniBottomSubtotals, value: 1 },
|
|
||||||
{ caption: this.mniTopSubtotals, value: 2 }
|
|
||||||
]
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
// this.lockedControls.push(this.btnPivotSubtotals); // remove commentings after enabled option
|
this.lockedControls.push(this.btnPivotSubtotals);
|
||||||
|
|
||||||
this.btnPivotGrandTotals = new Common.UI.Button({
|
this.btnPivotGrandTotals = new Common.UI.Button({
|
||||||
cls : 'btn-toolbar x-huge icon-top',
|
cls : 'btn-toolbar x-huge icon-top',
|
||||||
iconCls : 'btn-grand-totals',
|
iconCls : 'toolbar__icon btn-grand-totals',
|
||||||
caption : this.capGrandTotals,
|
caption : this.capGrandTotals,
|
||||||
disabled : true,
|
disabled : true,
|
||||||
menu : new Common.UI.Menu({
|
lock : [_set.lostConnect, _set.coAuth, _set.noPivot],
|
||||||
items: [
|
menu : true
|
||||||
{ caption: this.mniOffTotals, value: 0 },
|
|
||||||
{ caption: this.mniOnTotals, value: 1 },
|
|
||||||
{ caption: this.mniOnRowsTotals, value: 2 },
|
|
||||||
{ caption: this.mniOnColumnsTotals, value: 3 }
|
|
||||||
]
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
// this.lockedControls.push(this.btnPivotGrandTotals); // remove commentings after enabled option
|
this.lockedControls.push(this.btnPivotGrandTotals);
|
||||||
|
|
||||||
this.btnRefreshPivot = new Common.UI.Button({
|
this.btnRefreshPivot = new Common.UI.Button({
|
||||||
cls: 'btn-toolbar x-huge icon-top',
|
cls: 'btn-toolbar x-huge icon-top',
|
||||||
iconCls: 'btn-update-pivot',
|
iconCls: 'toolbar__icon btn-update-pivot',
|
||||||
caption: this.txtRefresh,
|
caption: this.txtRefresh,
|
||||||
disabled : true
|
disabled : true,
|
||||||
|
lock : [_set.lostConnect, _set.coAuth, _set.noPivot]
|
||||||
});
|
});
|
||||||
// this.lockedControls.push(this.btnRefreshPivot);
|
this.lockedControls.push(this.btnRefreshPivot);
|
||||||
|
|
||||||
this.btnSelectPivot = new Common.UI.Button({
|
this.btnSelectPivot = new Common.UI.Button({
|
||||||
cls: 'btn-toolbar x-huge icon-top',
|
cls: 'btn-toolbar x-huge icon-top',
|
||||||
iconCls: 'toolbar__icon btn-select-pivot',
|
iconCls: 'toolbar__icon btn-select-pivot',
|
||||||
caption: this.txtSelect
|
caption: this.txtSelect,
|
||||||
|
lock: [_set.lostConnect, _set.coAuth, _set.noPivot]
|
||||||
});
|
});
|
||||||
this.lockedControls.push(this.btnSelectPivot);
|
this.lockedControls.push(this.btnSelectPivot);
|
||||||
|
|
||||||
|
@ -263,8 +248,8 @@ define([
|
||||||
enableKeyEvents : true,
|
enableKeyEvents : true,
|
||||||
itemWidth : 61,
|
itemWidth : 61,
|
||||||
itemHeight : 49,
|
itemHeight : 49,
|
||||||
menuMaxHeight : 300
|
menuMaxHeight : 300,
|
||||||
// lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth]
|
lock : [_set.lostConnect, _set.coAuth, _set.noPivot]
|
||||||
});
|
});
|
||||||
this.lockedControls.push(this.pivotStyles);
|
this.lockedControls.push(this.pivotStyles);
|
||||||
|
|
||||||
|
@ -287,9 +272,43 @@ define([
|
||||||
me.btnRefreshPivot.updateHint(me.tipRefresh);
|
me.btnRefreshPivot.updateHint(me.tipRefresh);
|
||||||
me.btnSelectPivot.updateHint(me.tipSelect);
|
me.btnSelectPivot.updateHint(me.tipSelect);
|
||||||
me.btnPivotLayout.updateHint(me.capLayout);
|
me.btnPivotLayout.updateHint(me.capLayout);
|
||||||
|
me.btnPivotLayout.setMenu(new Common.UI.Menu({
|
||||||
|
items: [
|
||||||
|
{ caption: me.mniLayoutCompact, value: 0 },
|
||||||
|
{ caption: me.mniLayoutOutline, value: 1 },
|
||||||
|
{ caption: me.mniLayoutTabular, value: 2 },
|
||||||
|
{ caption: '--' },
|
||||||
|
{ caption: me.mniLayoutRepeat, value: 3 },
|
||||||
|
{ caption: me.mniLayoutNoRepeat, value: 4 }
|
||||||
|
]
|
||||||
|
}));
|
||||||
|
|
||||||
me.btnPivotBlankRows.updateHint(me.capBlankRows);
|
me.btnPivotBlankRows.updateHint(me.capBlankRows);
|
||||||
|
me.btnPivotBlankRows.setMenu( new Common.UI.Menu({
|
||||||
|
items: [
|
||||||
|
{ caption: me.mniInsertBlankLine, value: 'insert' },
|
||||||
|
{ caption: me.mniRemoveBlankLine, value: 'remove' }
|
||||||
|
]
|
||||||
|
}));
|
||||||
|
|
||||||
me.btnPivotSubtotals.updateHint(me.tipSubtotals);
|
me.btnPivotSubtotals.updateHint(me.tipSubtotals);
|
||||||
|
me.btnPivotSubtotals.setMenu(new Common.UI.Menu({
|
||||||
|
items: [
|
||||||
|
{ caption: me.mniNoSubtotals, value: 0 },
|
||||||
|
{ caption: me.mniBottomSubtotals, value: 1 },
|
||||||
|
{ caption: me.mniTopSubtotals, value: 2 }
|
||||||
|
]
|
||||||
|
}));
|
||||||
|
|
||||||
me.btnPivotGrandTotals.updateHint(me.tipGrandTotals);
|
me.btnPivotGrandTotals.updateHint(me.tipGrandTotals);
|
||||||
|
me.btnPivotGrandTotals.setMenu(new Common.UI.Menu({
|
||||||
|
items: [
|
||||||
|
{ caption: me.mniOffTotals, value: 0 },
|
||||||
|
{ caption: me.mniOnTotals, value: 1 },
|
||||||
|
{ caption: me.mniOnRowsTotals, value: 2 },
|
||||||
|
{ caption: me.mniOnColumnsTotals, value: 3 }
|
||||||
|
]
|
||||||
|
}));
|
||||||
|
|
||||||
setEvents.call(me);
|
setEvents.call(me);
|
||||||
});
|
});
|
||||||
|
@ -320,11 +339,12 @@ define([
|
||||||
this.fireEvent('show', this);
|
this.fireEvent('show', this);
|
||||||
},
|
},
|
||||||
|
|
||||||
getButton: function(type, parent) {
|
getButtons: function(type) {
|
||||||
|
return this.lockedControls.concat(this.btnAddPivot);
|
||||||
},
|
},
|
||||||
|
|
||||||
SetDisabled: function (state) {
|
SetDisabled: function (state) {
|
||||||
this.lockedControls && this.lockedControls.forEach(function(button) {
|
this.lockedControls.concat(this.btnAddPivot).forEach(function(button) {
|
||||||
if ( button ) {
|
if ( button ) {
|
||||||
button.setDisabled(state);
|
button.setDisabled(state);
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,8 @@ define([
|
||||||
namedRangeLock: 'named-range-lock',
|
namedRangeLock: 'named-range-lock',
|
||||||
multiselectCols:'is-multiselect-cols',
|
multiselectCols:'is-multiselect-cols',
|
||||||
headerLock: 'header-lock',
|
headerLock: 'header-lock',
|
||||||
sheetLock: 'sheet-lock'
|
sheetLock: 'sheet-lock',
|
||||||
|
noPivot: 'no-pivot'
|
||||||
};
|
};
|
||||||
|
|
||||||
SSE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend({
|
SSE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend({
|
||||||
|
|
|
@ -49,7 +49,7 @@ define([
|
||||||
SSE.Views.ValueFieldSettingsDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({
|
SSE.Views.ValueFieldSettingsDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({
|
||||||
options: {
|
options: {
|
||||||
contentWidth: 284,
|
contentWidth: 284,
|
||||||
height: 340
|
height: 220
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize : function(options) {
|
initialize : function(options) {
|
||||||
|
@ -74,41 +74,32 @@ define([
|
||||||
'<div id="value-field-settings-custom" style="width:264px;"></div>',
|
'<div id="value-field-settings-custom" style="width:264px;"></div>',
|
||||||
'</td>',
|
'</td>',
|
||||||
'</tr>',
|
'</tr>',
|
||||||
'<tr>',
|
|
||||||
'<td colspan="2" class="padding-small">',
|
|
||||||
'</td>',
|
|
||||||
'</tr>',
|
|
||||||
'<tr>',
|
'<tr>',
|
||||||
'<td colspan="2" class="padding-large">',
|
'<td colspan="2" class="padding-large">',
|
||||||
'<label class="header">', me.txtSummarize,'</label>',
|
'<label class="header">', me.txtSummarize,'</label>',
|
||||||
'<div id="value-field-settings-summarize" class="input-group-nr" style="width:264px;"></div>',
|
'<div id="value-field-settings-summarize" class="input-group-nr" style="width:264px;"></div>',
|
||||||
'</td>',
|
'</td>',
|
||||||
'</tr>',
|
'</tr>',
|
||||||
'<tr>',
|
// '<tr>',
|
||||||
'<td colspan="2" class="padding-small">',
|
// '<td colspan="2" class="padding-large">',
|
||||||
'</td>',
|
// '<label class="header">', me.txtShowAs,'</label>',
|
||||||
'</tr>',
|
// '<div id="value-field-settings-showas" class="input-group-nr" style="width:264px;"></div>',
|
||||||
'<tr>',
|
// '</td>',
|
||||||
'<td colspan="2" class="padding-large">',
|
// '</tr>',
|
||||||
'<label class="header">', me.txtShowAs,'</label>',
|
// '<tr class="format-code">',
|
||||||
'<div id="value-field-settings-showas" class="input-group-nr" style="width:264px;"></div>',
|
// '<td>',
|
||||||
'</td>',
|
// '<label class="header">', me.txtBaseField,'</label>',
|
||||||
'</tr>',
|
// '<div id="value-field-settings-field" class="input-group-nr" style="width:128px;"></div>',
|
||||||
'<tr class="format-code">',
|
// '</td>',
|
||||||
'<td>',
|
// '<td style="float: right;">',
|
||||||
'<label class="header">', me.txtBaseField,'</label>',
|
// '<label class="header">', me.txtBaseItem,'</label>',
|
||||||
'<div id="value-field-settings-field" class="input-group-nr" style="width:125px;"></div>',
|
// '<div id="value-field-settings-item" class="input-group-nr" style="width:128px;"></div>',
|
||||||
'</td>',
|
// '</td>',
|
||||||
'<td>',
|
// '</tr>',
|
||||||
'<label class="header">', me.txtBaseItem,'</label>',
|
|
||||||
'<div id="value-field-settings-item" class="input-group-nr" style="width:125px;"></div>',
|
|
||||||
'</td>',
|
|
||||||
'</tr>',
|
|
||||||
'</table>',
|
'</table>',
|
||||||
'</div></div>',
|
'</div></div>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'</div>',
|
'</div>'
|
||||||
'<div class="separator horizontal"/>'
|
|
||||||
].join('')
|
].join('')
|
||||||
}, options);
|
}, options);
|
||||||
|
|
||||||
|
@ -135,7 +126,8 @@ define([
|
||||||
this.cmbSummarize = new Common.UI.ComboBox({
|
this.cmbSummarize = new Common.UI.ComboBox({
|
||||||
el: $('#value-field-settings-summarize'),
|
el: $('#value-field-settings-summarize'),
|
||||||
cls: 'input-group-nr',
|
cls: 'input-group-nr',
|
||||||
menuStyle: 'min-width: 264px;',
|
menuStyle: 'min-width: 264px;max-height:160px;',
|
||||||
|
scrollAlwaysVisible: true,
|
||||||
editable: false,
|
editable: false,
|
||||||
data: [
|
data: [
|
||||||
{ value: Asc.c_oAscDataConsolidateFunction.Sum, displayValue: this.txtSum },
|
{ value: Asc.c_oAscDataConsolidateFunction.Sum, displayValue: this.txtSum },
|
||||||
|
@ -154,10 +146,11 @@ define([
|
||||||
this.cmbSummarize.setValue(Asc.c_oAscDataConsolidateFunction.Sum);
|
this.cmbSummarize.setValue(Asc.c_oAscDataConsolidateFunction.Sum);
|
||||||
this.cmbSummarize.on('selected', _.bind(this.onSummarizeSelect, this));
|
this.cmbSummarize.on('selected', _.bind(this.onSummarizeSelect, this));
|
||||||
|
|
||||||
|
/*
|
||||||
this.cmbShowAs = new Common.UI.ComboBox({
|
this.cmbShowAs = new Common.UI.ComboBox({
|
||||||
el: $('#value-field-settings-showas'),
|
el: $('#value-field-settings-showas'),
|
||||||
cls: 'input-group-nr',
|
cls: 'input-group-nr',
|
||||||
menuStyle: 'min-width: 264px;',
|
menuStyle: 'min-width: 264px;max-height:160px;',
|
||||||
editable: false,
|
editable: false,
|
||||||
data: [
|
data: [
|
||||||
{ value: Asc.c_oAscShowDataAs.Normal, displayValue: this.txtNormal },
|
{ value: Asc.c_oAscShowDataAs.Normal, displayValue: this.txtNormal },
|
||||||
|
@ -177,7 +170,7 @@ define([
|
||||||
this.cmbBaseField = new Common.UI.ComboBox({
|
this.cmbBaseField = new Common.UI.ComboBox({
|
||||||
el: $('#value-field-settings-field'),
|
el: $('#value-field-settings-field'),
|
||||||
cls: 'input-group-nr',
|
cls: 'input-group-nr',
|
||||||
menuStyle: 'min-width: 264px;max-height:235px;',
|
menuStyle: 'min-width: 100%;max-height:160px;',
|
||||||
editable: false,
|
editable: false,
|
||||||
data: [],
|
data: [],
|
||||||
scrollAlwaysVisible: true
|
scrollAlwaysVisible: true
|
||||||
|
@ -187,12 +180,13 @@ define([
|
||||||
this.cmbBaseItem = new Common.UI.ComboBox({
|
this.cmbBaseItem = new Common.UI.ComboBox({
|
||||||
el: $('#value-field-settings-item'),
|
el: $('#value-field-settings-item'),
|
||||||
cls: 'input-group-nr',
|
cls: 'input-group-nr',
|
||||||
menuStyle: 'min-width: 264px;max-height:235px;',
|
menuStyle: 'min-width: 100%;max-height:160px;',
|
||||||
editable: false,
|
editable: false,
|
||||||
data: [],
|
data: [],
|
||||||
scrollAlwaysVisible: true
|
scrollAlwaysVisible: true
|
||||||
});
|
});
|
||||||
this.cmbBaseItem.on('selected', _.bind(this.onBaseItemSelect, this));
|
this.cmbBaseItem.on('selected', _.bind(this.onBaseItemSelect, this));
|
||||||
|
*/
|
||||||
|
|
||||||
this.lblSourceName = this.$window.find('#value-field-settings-source');
|
this.lblSourceName = this.$window.find('#value-field-settings-source');
|
||||||
|
|
||||||
|
@ -210,15 +204,15 @@ define([
|
||||||
_setDefaults: function (props) {
|
_setDefaults: function (props) {
|
||||||
if (props) {
|
if (props) {
|
||||||
var field = this.field,
|
var field = this.field,
|
||||||
cache_names = props.asc_getCacheFields(),
|
cache_names = props.asc_getCacheFields();
|
||||||
show_as = field.asc_getShowDataAs();
|
|
||||||
|
|
||||||
this.lblSourceName.html(Common.Utils.String.htmlEncode(cache_names[field.asc_getIndex()].asc_getName()));
|
this.lblSourceName.html(Common.Utils.String.htmlEncode(cache_names[field.asc_getIndex()].asc_getName()));
|
||||||
this.inputCustomName.setValue(Common.Utils.String.htmlEncode(field.asc_getName()));
|
this.inputCustomName.setValue(Common.Utils.String.htmlEncode(field.asc_getName()));
|
||||||
|
|
||||||
this.cmbSummarize.setValue(field.asc_getSubtotal());
|
this.cmbSummarize.setValue(field.asc_getSubtotal());
|
||||||
this.cmbShowAs.setValue(show_as);
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
var show_as = field.asc_getShowDataAs();
|
||||||
|
this.cmbShowAs.setValue(show_as);
|
||||||
var data = [];
|
var data = [];
|
||||||
this.names.forEach(function(item){
|
this.names.forEach(function(item){
|
||||||
data.push({value: item, displayValue: item});
|
data.push({value: item, displayValue: item});
|
||||||
|
@ -231,6 +225,7 @@ define([
|
||||||
// this.cmbBaseItem.setData(data);
|
// this.cmbBaseItem.setData(data);
|
||||||
this.cmbBaseItem.setDisabled(show_as != c_oAscShowDataAs.Difference && show_as != c_oAscShowDataAs.Percent &&
|
this.cmbBaseItem.setDisabled(show_as != c_oAscShowDataAs.Difference && show_as != c_oAscShowDataAs.Percent &&
|
||||||
show_as != c_oAscShowDataAs.PercentDiff);
|
show_as != c_oAscShowDataAs.PercentDiff);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -262,6 +257,9 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onShowAsSelect: function(combo, record) {
|
onShowAsSelect: function(combo, record) {
|
||||||
|
// var show_as = record.value;
|
||||||
|
// this.cmbBaseField.setDisabled(show_as != c_oAscShowDataAs.Difference && show_as != c_oAscShowDataAs.Percent &&
|
||||||
|
// show_as != c_oAscShowDataAs.PercentDiff && show_as != c_oAscShowDataAs.RunTotal);
|
||||||
},
|
},
|
||||||
|
|
||||||
onBaseFieldSelect: function(combo, record) {
|
onBaseFieldSelect: function(combo, record) {
|
||||||
|
|
|
@ -465,6 +465,7 @@
|
||||||
"SSE.Controllers.Main.errorInvalidRef": "Enter a correct name for the selection or a valid reference to go to.",
|
"SSE.Controllers.Main.errorInvalidRef": "Enter a correct name for the selection or a valid reference to go to.",
|
||||||
"SSE.Controllers.Main.errorKeyEncrypt": "Unknown key descriptor",
|
"SSE.Controllers.Main.errorKeyEncrypt": "Unknown key descriptor",
|
||||||
"SSE.Controllers.Main.errorKeyExpire": "Key descriptor expired",
|
"SSE.Controllers.Main.errorKeyExpire": "Key descriptor expired",
|
||||||
|
"SSE.Controllers.Main.errorLabledColumnsPivot": "To create a pivot table, you must use data that is organized as a list with labeled columns.",
|
||||||
"SSE.Controllers.Main.errorLockedAll": "The operation could not be done as the sheet has been locked by another user.",
|
"SSE.Controllers.Main.errorLockedAll": "The operation could not be done as the sheet has been locked by another user.",
|
||||||
"SSE.Controllers.Main.errorLockedCellPivot": "You cannot change data inside a pivot table.",
|
"SSE.Controllers.Main.errorLockedCellPivot": "You cannot change data inside a pivot table.",
|
||||||
"SSE.Controllers.Main.errorLockedWorksheetRename": "The sheet cannot be renamed at the moment as it is being renamed by another user",
|
"SSE.Controllers.Main.errorLockedWorksheetRename": "The sheet cannot be renamed at the moment as it is being renamed by another user",
|
||||||
|
@ -494,6 +495,7 @@
|
||||||
"SSE.Controllers.Main.errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br>Please correct the error.",
|
"SSE.Controllers.Main.errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br>Please correct the error.",
|
||||||
"SSE.Controllers.Main.errorFTChangeTableRangeError": "Operation could not be completed for the selected cell range.<br>Select a range so that the first table row was on the same row<br>and the resulting table overlapped the current one.",
|
"SSE.Controllers.Main.errorFTChangeTableRangeError": "Operation could not be completed for the selected cell range.<br>Select a range so that the first table row was on the same row<br>and the resulting table overlapped the current one.",
|
||||||
"SSE.Controllers.Main.errorFTRangeIncludedOtherTables": "Operation could not be completed for the selected cell range.<br>Select a range which does not include other tables.",
|
"SSE.Controllers.Main.errorFTRangeIncludedOtherTables": "Operation could not be completed for the selected cell range.<br>Select a range which does not include other tables.",
|
||||||
|
"SSE.Controllers.Main.errorPivotOverlap": "A pivot table report cannot overlap a table.",
|
||||||
"SSE.Controllers.Main.leavePageText": "You have unsaved changes in this spreadsheet. Click 'Stay on this Page' then 'Save' to save them. Click 'Leave this Page' to discard all the unsaved changes.",
|
"SSE.Controllers.Main.leavePageText": "You have unsaved changes in this spreadsheet. Click 'Stay on this Page' then 'Save' to save them. Click 'Leave this Page' to discard all the unsaved changes.",
|
||||||
"SSE.Controllers.Main.loadFontsTextText": "Loading data...",
|
"SSE.Controllers.Main.loadFontsTextText": "Loading data...",
|
||||||
"SSE.Controllers.Main.loadFontsTitleText": "Loading Data",
|
"SSE.Controllers.Main.loadFontsTitleText": "Loading Data",
|
||||||
|
@ -1359,6 +1361,14 @@
|
||||||
"SSE.Views.ChartSettingsDlg.textYAxisTitle": "Y Axis Title",
|
"SSE.Views.ChartSettingsDlg.textYAxisTitle": "Y Axis Title",
|
||||||
"SSE.Views.ChartSettingsDlg.textZero": "Zero",
|
"SSE.Views.ChartSettingsDlg.textZero": "Zero",
|
||||||
"SSE.Views.ChartSettingsDlg.txtEmpty": "This field is required",
|
"SSE.Views.ChartSettingsDlg.txtEmpty": "This field is required",
|
||||||
|
"SSE.Views.CreatePivotDialog.textTitle": "Create Table",
|
||||||
|
"SSE.Views.CreatePivotDialog.textDataRange": "Source data range",
|
||||||
|
"SSE.Views.CreatePivotDialog.textSelectData": "Select",
|
||||||
|
"SSE.Views.CreatePivotDialog.textDestination": "Choose, where to place the table",
|
||||||
|
"SSE.Views.CreatePivotDialog.textNew": "New worksheet",
|
||||||
|
"SSE.Views.CreatePivotDialog.textExist": "Existing worksheet",
|
||||||
|
"SSE.Views.CreatePivotDialog.txtEmpty": "This field is required",
|
||||||
|
"SSE.Views.CreatePivotDialog.textInvalidRange": "Invalid cells range",
|
||||||
"SSE.Views.DataTab.capBtnGroup": "Group",
|
"SSE.Views.DataTab.capBtnGroup": "Group",
|
||||||
"SSE.Views.DataTab.capBtnTextCustomSort": "Custom Sort",
|
"SSE.Views.DataTab.capBtnTextCustomSort": "Custom Sort",
|
||||||
"SSE.Views.DataTab.capBtnTextToCol": "Text to Columns",
|
"SSE.Views.DataTab.capBtnTextToCol": "Text to Columns",
|
||||||
|
@ -1517,6 +1527,33 @@
|
||||||
"SSE.Views.DocumentHolder.txtUngroup": "Ungroup",
|
"SSE.Views.DocumentHolder.txtUngroup": "Ungroup",
|
||||||
"SSE.Views.DocumentHolder.txtWidth": "Width",
|
"SSE.Views.DocumentHolder.txtWidth": "Width",
|
||||||
"SSE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
|
"SSE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
|
||||||
|
"SSE.Views.FieldSettingsDialog.textTitle": "Field Settings",
|
||||||
|
"SSE.Views.FieldSettingsDialog.strSubtotals": "Subtotals",
|
||||||
|
"SSE.Views.FieldSettingsDialog.strLayout": "Layout",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtSourceName": "Source name:",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtCustomName": "Custom name",
|
||||||
|
"SSE.Views.FieldSettingsDialog.textReport": "Report Form",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtTabular": "Tabular",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtOutline": "Outline",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtCompact": "Compact",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtRepeat": "Repeat items labels at each row",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtBlank": "Insert blank rows after each item",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtShowSubtotals": "Show subtotals",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtTop": "Show at top of group",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtBottom": "Show at bottom of group",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtEmpty": "Show items with no data",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtSummarize": "Functions for Subtotals",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtAverage": "Average",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtCount": "Count",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtCountNums": "Count Numbers",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtMax": "Max",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtMin": "Min",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtProduct": "Product",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtStdDev": "StdDev",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtStdDevp": "StdDevp",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtSum": "Sum",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtVar": "Var",
|
||||||
|
"SSE.Views.FieldSettingsDialog.txtVarp": "Varp",
|
||||||
"SSE.Views.FileMenu.btnBackCaption": "Open file location",
|
"SSE.Views.FileMenu.btnBackCaption": "Open file location",
|
||||||
"SSE.Views.FileMenu.btnCloseMenuCaption": "Close Menu",
|
"SSE.Views.FileMenu.btnCloseMenuCaption": "Close Menu",
|
||||||
"SSE.Views.FileMenu.btnCreateNewCaption": "Create New",
|
"SSE.Views.FileMenu.btnCreateNewCaption": "Create New",
|
||||||
|
@ -1874,7 +1911,7 @@
|
||||||
"SSE.Views.ParagraphSettingsAdvanced.textTabRight": "Right",
|
"SSE.Views.ParagraphSettingsAdvanced.textTabRight": "Right",
|
||||||
"SSE.Views.ParagraphSettingsAdvanced.textTitle": "Paragraph - Advanced Settings",
|
"SSE.Views.ParagraphSettingsAdvanced.textTitle": "Paragraph - Advanced Settings",
|
||||||
"SSE.Views.ParagraphSettingsAdvanced.txtAutoText": "Auto",
|
"SSE.Views.ParagraphSettingsAdvanced.txtAutoText": "Auto",
|
||||||
"SSE.Views.PivotSettings.notcriticalErrorTitle": "Warning",
|
"del_SSE.Views.PivotSettings.notcriticalErrorTitle": "Warning",
|
||||||
"SSE.Views.PivotSettings.textAdvanced": "Show advanced settings",
|
"SSE.Views.PivotSettings.textAdvanced": "Show advanced settings",
|
||||||
"SSE.Views.PivotSettings.textColumns": "Columns",
|
"SSE.Views.PivotSettings.textColumns": "Columns",
|
||||||
"SSE.Views.PivotSettings.textFields": "Select Fields",
|
"SSE.Views.PivotSettings.textFields": "Select Fields",
|
||||||
|
@ -1895,6 +1932,28 @@
|
||||||
"SSE.Views.PivotSettings.txtMoveUp": "Move Up",
|
"SSE.Views.PivotSettings.txtMoveUp": "Move Up",
|
||||||
"SSE.Views.PivotSettings.txtMoveValues": "Move to Values",
|
"SSE.Views.PivotSettings.txtMoveValues": "Move to Values",
|
||||||
"SSE.Views.PivotSettings.txtRemove": "Remove Field",
|
"SSE.Views.PivotSettings.txtRemove": "Remove Field",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.textTitle": "Pivot Table - Advanced Settings",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.strLayout": "Name and Layout",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.txtName": "Name",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.textGrandTotals": "Grand Totals",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.textShowRows": "Show for rows",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.textShowCols": "Show for columns",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.textDataSource": "Data Source",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.textDataRange": "Data Range",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.textSelectData": "Select Data",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.textAlt": "Alternative Text",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.textAltTitle": "Title",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.textAltDescription": "Description",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.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.",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.txtEmpty": "This field is required",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.textInvalidRange": "ERROR! Invalid cells range",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.textDisplayFields": "Display fields in report filter area",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.textDown": "Down, then over",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.textOver": "Over, then down",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.textWrapCol": "Report filter fields per column",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.textWrapRow": "Report filter fields per row",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.textHeaders": "Field Headers",
|
||||||
|
"SSE.Views.PivotSettingsAdvanced.textShowHeaders": "Show field headers for rows and columns",
|
||||||
"SSE.Views.PivotTable.capBlankRows": "Blank Rows",
|
"SSE.Views.PivotTable.capBlankRows": "Blank Rows",
|
||||||
"SSE.Views.PivotTable.capGrandTotals": "Grand Totals",
|
"SSE.Views.PivotTable.capGrandTotals": "Grand Totals",
|
||||||
"SSE.Views.PivotTable.capLayout": "Report Layout",
|
"SSE.Views.PivotTable.capLayout": "Report Layout",
|
||||||
|
@ -2525,5 +2584,33 @@
|
||||||
"SSE.Views.Top10FilterDialog.txtItems": "Item",
|
"SSE.Views.Top10FilterDialog.txtItems": "Item",
|
||||||
"SSE.Views.Top10FilterDialog.txtPercent": "Percent",
|
"SSE.Views.Top10FilterDialog.txtPercent": "Percent",
|
||||||
"SSE.Views.Top10FilterDialog.txtTitle": "Top 10 AutoFilter",
|
"SSE.Views.Top10FilterDialog.txtTitle": "Top 10 AutoFilter",
|
||||||
"SSE.Views.Top10FilterDialog.txtTop": "Top"
|
"SSE.Views.Top10FilterDialog.txtTop": "Top",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.textTitle": "Value Field Settings",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtSourceName": "Source name:",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtCustomName": "Custom name",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtSummarize": "Summarize value field by",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtShowAs": "Show values as",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtBaseField": "Base field",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtBaseItem": "Base item",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtAverage": "Average",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtCount": "Count",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtCountNums": "Count Numbers",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtMax": "Max",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtMin": "Min",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtProduct": "Product",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtStdDev": "StdDev",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtStdDevp": "StdDevp",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtSum": "Sum",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtVar": "Var",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtVarp": "Varp",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtNormal": "No Calculation",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtDifference": "The Difference From",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtPercent": "Percent of",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtPercentDiff": "Percent Difference From",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtRunTotal": "Running Total In",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtPercentOfRow": "Percent of Total",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtPercentOfCol": "Percent of Column",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtPercentOfTotal": "Percent of Row",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtIndex": "Index",
|
||||||
|
"SSE.Views.ValueFieldSettingsDialog.txtByField": "by field"
|
||||||
}
|
}
|
|
@ -208,8 +208,18 @@ button:active:not(.disabled) .btn-change-shape {background-position: -56px -
|
||||||
width: 95px;
|
width: 95px;
|
||||||
height: 130px;
|
height: 130px;
|
||||||
|
|
||||||
.item {
|
.listview:not(.disabled) > .item {
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
|
border-top: none;
|
||||||
|
&.insert {
|
||||||
|
background: linear-gradient(to bottom, #656565, #fff 5%);
|
||||||
|
&.last {
|
||||||
|
background: linear-gradient(to top, #656565, #fff 5%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
border-top: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-item > div:nth-child(1) {
|
.list-item > div:nth-child(1) {
|
||||||
|
|
Loading…
Reference in a new issue