2017-01-18 08:08:19 +00:00
|
|
|
/*
|
|
|
|
*
|
2019-01-17 13:05:03 +00:00
|
|
|
* (c) Copyright Ascensio System SIA 2010-2019
|
2017-01-18 08:08:19 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*
|
2019-01-17 13:00:34 +00:00
|
|
|
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
|
|
|
* street, Riga, Latvia, EU, LV-1050.
|
2017-01-18 08:08:19 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2016-03-29 08:11:58 +00:00
|
|
|
/**
|
|
|
|
* TableSettings.js
|
|
|
|
*
|
|
|
|
* Created by Julia Radzhabova on 3/28/16
|
2018-03-01 12:16:38 +00:00
|
|
|
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
2016-03-29 08:11:58 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
define([
|
|
|
|
'text!spreadsheeteditor/main/app/template/TableSettings.template',
|
|
|
|
'jquery',
|
|
|
|
'underscore',
|
|
|
|
'backbone',
|
|
|
|
'common/main/lib/component/Button',
|
|
|
|
'common/main/lib/component/CheckBox',
|
|
|
|
'common/main/lib/component/ComboDataView',
|
2017-01-19 11:08:51 +00:00
|
|
|
'spreadsheeteditor/main/app/view/TableOptionsDialog',
|
2020-06-05 10:42:20 +00:00
|
|
|
'spreadsheeteditor/main/app/view/TableSettingsAdvanced',
|
|
|
|
'spreadsheeteditor/main/app/view/SlicerAddDialog'
|
2016-03-29 08:11:58 +00:00
|
|
|
], function (menuTemplate, $, _, Backbone) {
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
SSE.Views.TableSettings = Backbone.View.extend(_.extend({
|
|
|
|
el: '#id-table-settings',
|
|
|
|
|
|
|
|
// Compile our stats template
|
|
|
|
template: _.template(menuTemplate),
|
|
|
|
|
|
|
|
// Delegated events for creating new items, and clearing completed ones.
|
|
|
|
events: {
|
|
|
|
},
|
|
|
|
|
|
|
|
options: {
|
|
|
|
alias: 'TableSettings'
|
|
|
|
},
|
|
|
|
|
|
|
|
initialize: function () {
|
2016-08-24 08:44:45 +00:00
|
|
|
this._initSettings = true;
|
2016-03-29 08:11:58 +00:00
|
|
|
|
|
|
|
this._state = {
|
2016-03-29 14:35:28 +00:00
|
|
|
TableName: '',
|
2016-03-29 08:11:58 +00:00
|
|
|
TemplateName: '',
|
2016-03-30 12:27:16 +00:00
|
|
|
Range: '',
|
2016-03-29 08:11:58 +00:00
|
|
|
CheckHeader: false,
|
|
|
|
CheckTotal: false,
|
|
|
|
CheckBanded: false,
|
|
|
|
CheckFirst: false,
|
|
|
|
CheckLast: false,
|
|
|
|
CheckColBanded: false,
|
|
|
|
CheckFilter: false,
|
2016-03-30 12:27:16 +00:00
|
|
|
DisabledControls: false,
|
|
|
|
TableNameError: false
|
2016-03-29 08:11:58 +00:00
|
|
|
};
|
|
|
|
this.lockedControls = [];
|
|
|
|
this._locked = false;
|
2021-07-19 17:48:36 +00:00
|
|
|
this.wsLock = false;
|
|
|
|
this.wsProps = [];
|
2018-06-13 15:43:52 +00:00
|
|
|
this.isEditCell = false;
|
2016-03-29 08:11:58 +00:00
|
|
|
|
|
|
|
this._originalProps = null;
|
|
|
|
this._noApply = false;
|
|
|
|
|
|
|
|
this.render();
|
2016-08-24 08:44:45 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
onCheckTemplateChange: function(type, stateName, field, newValue, oldValue, eOpts) {
|
|
|
|
this._state[stateName] = undefined;
|
|
|
|
if (this.api)
|
|
|
|
this.api.asc_changeFormatTableInfo(this._state.TableName, type, newValue=='checked');
|
|
|
|
Common.NotificationCenter.trigger('edit:complete', this);
|
|
|
|
},
|
|
|
|
|
2019-12-13 14:18:11 +00:00
|
|
|
onTableTemplateSelect: function(btn, picker, itemView, record){
|
2016-08-24 08:44:45 +00:00
|
|
|
if (this.api && !this._noApply) {
|
|
|
|
this.api.asc_changeAutoFilter(this._state.TableName, Asc.c_oAscChangeFilterOptions.style, record.get('name'));
|
|
|
|
}
|
|
|
|
Common.NotificationCenter.trigger('edit:complete', this);
|
|
|
|
},
|
2016-03-29 08:11:58 +00:00
|
|
|
|
2016-08-24 08:44:45 +00:00
|
|
|
onEditClick: function(menu, item, e) {
|
|
|
|
if (this.api) {
|
|
|
|
if (item.options.idx>=0 && item.options.idx<4)
|
|
|
|
this.api.asc_changeSelectionFormatTable(this._state.TableName, item.value);
|
|
|
|
else if (item.options.idx>=4 && item.options.idx<8) {
|
|
|
|
this.api.asc_insertCellsInTable(this._state.TableName, item.value);
|
|
|
|
} else {
|
|
|
|
this.api.asc_deleteCellsInTable(this._state.TableName, item.value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Common.NotificationCenter.trigger('edit:complete', this);
|
|
|
|
},
|
|
|
|
|
|
|
|
onTableNameChanged: function(input, newValue, oldValue) {
|
|
|
|
var oldName = this._state.TableName;
|
|
|
|
this._state.TableName = '';
|
|
|
|
|
|
|
|
if (oldName.toLowerCase() == newValue.toLowerCase()) {
|
|
|
|
Common.NotificationCenter.trigger('edit:complete', this);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
var me = this,
|
|
|
|
isvalid = this.api.asc_checkDefinedName(newValue, null);
|
|
|
|
if (isvalid.asc_getStatus() === true) isvalid = true;
|
|
|
|
else {
|
|
|
|
switch (isvalid.asc_getReason()) {
|
|
|
|
case Asc.c_oAscDefinedNameReason.IsLocked:
|
|
|
|
isvalid = this.textIsLocked;
|
|
|
|
break;
|
|
|
|
case Asc.c_oAscDefinedNameReason.Existed:
|
|
|
|
isvalid = this.textExistName;
|
|
|
|
break;
|
|
|
|
case Asc.c_oAscDefinedNameReason.NameReserved:
|
|
|
|
isvalid = this.textReservedName;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
isvalid = this.textInvalidName;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (isvalid === true) {
|
|
|
|
this.api.asc_changeDisplayNameTable(oldName, newValue);
|
|
|
|
Common.NotificationCenter.trigger('edit:complete', this);
|
|
|
|
} else if (!this._state.TableNameError) {
|
|
|
|
this._state.TableNameError = true;
|
|
|
|
Common.UI.alert({
|
|
|
|
msg: isvalid,
|
|
|
|
title: this.notcriticalErrorTitle,
|
|
|
|
iconCls: 'warn',
|
|
|
|
buttons: ['ok'],
|
|
|
|
callback: function(btn){
|
|
|
|
Common.NotificationCenter.trigger('edit:complete', this);
|
|
|
|
me._state.TableNameError = false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
render: function () {
|
|
|
|
var el = $(this.el);
|
|
|
|
el.html(this.template({
|
|
|
|
scope: this
|
|
|
|
}));
|
2017-01-19 11:08:51 +00:00
|
|
|
|
|
|
|
this.linkAdvanced = $('#table-advanced-link');
|
2016-08-24 08:44:45 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
setApi: function(o) {
|
|
|
|
this.api = o;
|
|
|
|
if (o) {
|
2016-11-29 12:48:18 +00:00
|
|
|
this.api.asc_registerCallback('asc_onSendThemeColors', _.bind(this.onSendThemeColors, this));
|
2018-06-13 15:43:52 +00:00
|
|
|
this.api.asc_registerCallback('asc_onEditCell', this.onApiEditCell.bind(this));
|
2016-08-24 08:44:45 +00:00
|
|
|
}
|
|
|
|
return this;
|
|
|
|
},
|
|
|
|
|
2020-06-22 13:01:05 +00:00
|
|
|
setMode: function(mode) {
|
|
|
|
this.mode = mode;
|
|
|
|
},
|
|
|
|
|
2016-08-24 08:44:45 +00:00
|
|
|
createDelayedControls: function() {
|
|
|
|
var me = this;
|
2016-03-29 08:11:58 +00:00
|
|
|
this.chHeader = new Common.UI.CheckBox({
|
|
|
|
el: $('#table-checkbox-header'),
|
2021-06-08 14:26:10 +00:00
|
|
|
labelText: this.textHeader,
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'left',
|
|
|
|
dataHintOffset: 'small'
|
2016-03-29 08:11:58 +00:00
|
|
|
});
|
|
|
|
this.lockedControls.push(this.chHeader);
|
|
|
|
|
|
|
|
this.chTotal = new Common.UI.CheckBox({
|
|
|
|
el: $('#table-checkbox-total'),
|
2021-06-08 14:26:10 +00:00
|
|
|
labelText: this.textTotal,
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'left',
|
|
|
|
dataHintOffset: 'small'
|
2016-03-29 08:11:58 +00:00
|
|
|
});
|
|
|
|
this.lockedControls.push(this.chTotal);
|
|
|
|
|
|
|
|
this.chBanded = new Common.UI.CheckBox({
|
|
|
|
el: $('#table-checkbox-banded'),
|
2021-06-08 14:26:10 +00:00
|
|
|
labelText: this.textBanded,
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'left',
|
|
|
|
dataHintOffset: 'small'
|
2016-03-29 08:11:58 +00:00
|
|
|
});
|
|
|
|
this.lockedControls.push(this.chBanded);
|
|
|
|
|
|
|
|
this.chFirst = new Common.UI.CheckBox({
|
|
|
|
el: $('#table-checkbox-first'),
|
2021-06-08 14:26:10 +00:00
|
|
|
labelText: this.textFirst,
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'left',
|
|
|
|
dataHintOffset: 'small'
|
2016-03-29 08:11:58 +00:00
|
|
|
});
|
|
|
|
this.lockedControls.push(this.chFirst);
|
|
|
|
|
|
|
|
this.chLast = new Common.UI.CheckBox({
|
|
|
|
el: $('#table-checkbox-last'),
|
2021-06-08 14:26:10 +00:00
|
|
|
labelText: this.textLast,
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'left',
|
|
|
|
dataHintOffset: 'small'
|
2016-03-29 08:11:58 +00:00
|
|
|
});
|
|
|
|
this.lockedControls.push(this.chLast);
|
|
|
|
|
|
|
|
this.chColBanded = new Common.UI.CheckBox({
|
|
|
|
el: $('#table-checkbox-col-banded'),
|
2021-06-08 14:26:10 +00:00
|
|
|
labelText: this.textBanded,
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'left',
|
|
|
|
dataHintOffset: 'small'
|
2016-03-29 08:11:58 +00:00
|
|
|
});
|
|
|
|
this.lockedControls.push(this.chColBanded);
|
|
|
|
|
|
|
|
this.chFilter = new Common.UI.CheckBox({
|
|
|
|
el: $('#table-checkbox-filter'),
|
2021-06-08 14:26:10 +00:00
|
|
|
labelText: this.textFilter,
|
|
|
|
dataHint: '1',
|
|
|
|
dataHintDirection: 'left',
|
|
|
|
dataHintOffset: 'small'
|
2016-03-29 08:11:58 +00:00
|
|
|
});
|
|
|
|
this.lockedControls.push(this.chFilter);
|
|
|
|
|
2016-06-20 10:30:10 +00:00
|
|
|
this.chHeader.on('change', _.bind(this.onCheckTemplateChange, this, Asc.c_oAscChangeTableStyleInfo.rowHeader, 'CheckHeader'));
|
|
|
|
this.chTotal.on('change', _.bind(this.onCheckTemplateChange, this, Asc.c_oAscChangeTableStyleInfo.rowTotal, 'CheckTotal'));
|
|
|
|
this.chBanded.on('change', _.bind(this.onCheckTemplateChange, this, Asc.c_oAscChangeTableStyleInfo.rowBanded, 'CheckBanded'));
|
|
|
|
this.chFirst.on('change', _.bind(this.onCheckTemplateChange, this, Asc.c_oAscChangeTableStyleInfo.columnFirst, 'CheckFirst'));
|
|
|
|
this.chLast.on('change', _.bind(this.onCheckTemplateChange, this, Asc.c_oAscChangeTableStyleInfo.columnLast, 'CheckLast'));
|
|
|
|
this.chColBanded.on('change', _.bind(this.onCheckTemplateChange, this, Asc.c_oAscChangeTableStyleInfo.columnBanded, 'CheckColBanded'));
|
|
|
|
this.chFilter.on('change', _.bind(this.onCheckTemplateChange, this, Asc.c_oAscChangeTableStyleInfo.filterButton, 'CheckFilter'));
|
2016-03-29 08:11:58 +00:00
|
|
|
|
|
|
|
this.txtTableName = new Common.UI.InputField({
|
|
|
|
el : $('#table-txt-name'),
|
2016-03-30 14:29:35 +00:00
|
|
|
name : 'tablename',
|
2016-03-29 08:11:58 +00:00
|
|
|
style : 'width: 100%;',
|
2016-03-30 10:45:04 +00:00
|
|
|
validateOnBlur: false
|
2016-03-29 08:11:58 +00:00
|
|
|
});
|
2016-03-30 12:27:16 +00:00
|
|
|
this.txtTableName.on('changed:after', _.bind(this.onTableNameChanged, this));
|
2016-03-29 08:11:58 +00:00
|
|
|
this.lockedControls.push(this.txtTableName);
|
|
|
|
|
|
|
|
this.btnSelectData = new Common.UI.Button({
|
2021-12-04 19:59:28 +00:00
|
|
|
parentEl: $('#table-btn-select-data'),
|
|
|
|
cls : 'btn-toolbar align-left',
|
|
|
|
iconCls : 'toolbar__icon resize-table',
|
|
|
|
caption : this.textResize,
|
|
|
|
style : 'width: 100%;',
|
|
|
|
dataHint : '1',
|
|
|
|
dataHintDirection: 'left',
|
|
|
|
dataHintOffset: 'small'
|
2016-03-29 08:11:58 +00:00
|
|
|
});
|
|
|
|
this.btnSelectData.on('click', _.bind(this.onSelectData, this));
|
2016-04-21 10:15:15 +00:00
|
|
|
this.lockedControls.push(this.btnSelectData);
|
2016-03-29 08:11:58 +00:00
|
|
|
|
|
|
|
this.btnEdit = new Common.UI.Button({
|
2020-04-29 07:36:53 +00:00
|
|
|
parentEl: $('#table-btn-edit'),
|
2021-12-04 19:59:28 +00:00
|
|
|
cls : 'btn-toolbar align-left',
|
|
|
|
iconCls : 'toolbar__icon rows-and-columns',
|
|
|
|
caption : this.textEdit,
|
|
|
|
style : 'width: 100%;',
|
|
|
|
menu: new Common.UI.Menu({
|
2016-03-29 08:11:58 +00:00
|
|
|
menuAlign: 'tr-br',
|
|
|
|
items: [
|
2016-04-08 11:20:34 +00:00
|
|
|
{ caption: this.selectRowText, value: Asc.c_oAscChangeSelectionFormatTable.row, idx: 0 },
|
|
|
|
{ caption: this.selectColumnText, value: Asc.c_oAscChangeSelectionFormatTable.column, idx: 1 },
|
|
|
|
{ caption: this.selectDataText, value: Asc.c_oAscChangeSelectionFormatTable.data, idx: 2 },
|
|
|
|
{ caption: this.selectTableText, value: Asc.c_oAscChangeSelectionFormatTable.all, idx: 3 },
|
2016-03-29 08:11:58 +00:00
|
|
|
{ caption: '--' },
|
2016-04-08 11:20:34 +00:00
|
|
|
{ caption: this.insertRowAboveText, value: Asc.c_oAscInsertOptions.InsertTableRowAbove, idx: 4 },
|
|
|
|
{ caption: this.insertRowBelowText, value: Asc.c_oAscInsertOptions.InsertTableRowBelow, idx: 5 },
|
|
|
|
{ caption: this.insertColumnLeftText, value: Asc.c_oAscInsertOptions.InsertTableColLeft, idx: 6 },
|
|
|
|
{ caption: this.insertColumnRightText, value: Asc.c_oAscInsertOptions.InsertTableColRight, idx: 7 },
|
2016-03-29 08:11:58 +00:00
|
|
|
{ caption: '--' },
|
2016-04-08 11:20:34 +00:00
|
|
|
{ caption: this.deleteRowText, value: Asc.c_oAscDeleteOptions.DeleteRows, idx: 8 },
|
|
|
|
{ caption: this.deleteColumnText, value: Asc.c_oAscDeleteOptions.DeleteColumns, idx: 9 },
|
|
|
|
{ caption: this.deleteTableText, value: Asc.c_oAscDeleteOptions.DeleteTable, idx: 10 }
|
2016-03-29 08:11:58 +00:00
|
|
|
]
|
2021-06-08 14:26:10 +00:00
|
|
|
}),
|
2021-12-04 19:59:28 +00:00
|
|
|
dataHint : '1',
|
|
|
|
dataHintDirection: 'left',
|
|
|
|
dataHintOffset: 'small'
|
2016-03-29 08:11:58 +00:00
|
|
|
});
|
2021-12-04 19:59:28 +00:00
|
|
|
|
2016-04-01 13:30:53 +00:00
|
|
|
this.btnEdit.menu.on('show:after', _.bind( function(menu){
|
2016-03-29 08:11:58 +00:00
|
|
|
if (this.api) {
|
2016-04-01 13:30:53 +00:00
|
|
|
menu.items[5].setDisabled(!this._originalProps.asc_getIsInsertRowAbove());
|
|
|
|
menu.items[6].setDisabled(!this._originalProps.asc_getIsInsertRowBelow());
|
|
|
|
menu.items[7].setDisabled(!this._originalProps.asc_getIsInsertColumnLeft());
|
|
|
|
menu.items[8].setDisabled(!this._originalProps.asc_getIsInsertColumnRight());
|
|
|
|
|
|
|
|
menu.items[10].setDisabled(!this._originalProps.asc_getIsDeleteRow());
|
|
|
|
menu.items[11].setDisabled(!this._originalProps.asc_getIsDeleteColumn());
|
|
|
|
menu.items[12].setDisabled(!this._originalProps.asc_getIsDeleteTable());
|
2016-03-29 08:11:58 +00:00
|
|
|
}
|
|
|
|
}, this));
|
|
|
|
this.btnEdit.menu.on('item:click', _.bind(this.onEditClick, this));
|
|
|
|
this.lockedControls.push(this.btnEdit);
|
2016-10-12 15:38:10 +00:00
|
|
|
|
2017-04-11 11:05:56 +00:00
|
|
|
this.btnConvertRange = new Common.UI.Button({
|
2020-07-14 11:27:45 +00:00
|
|
|
parentEl: $('#table-btn-convert-range'),
|
2021-12-04 19:59:28 +00:00
|
|
|
cls : 'btn-toolbar align-left',
|
2020-07-14 11:27:45 +00:00
|
|
|
iconCls : 'toolbar__icon btn-convert-to-range',
|
|
|
|
caption : this.textConvertRange,
|
2021-12-04 19:59:28 +00:00
|
|
|
style : 'width: 100%;',
|
2021-06-08 14:26:10 +00:00
|
|
|
dataHint : '1',
|
|
|
|
dataHintDirection: 'left',
|
|
|
|
dataHintOffset: 'small'
|
2017-04-11 11:05:56 +00:00
|
|
|
});
|
2020-07-14 11:27:45 +00:00
|
|
|
|
2017-04-11 11:05:56 +00:00
|
|
|
this.btnConvertRange.on('click', _.bind(function(btn){
|
|
|
|
if (this.api) this.api.asc_convertTableToRange(this._state.TableName);
|
|
|
|
Common.NotificationCenter.trigger('edit:complete', this);
|
|
|
|
}, this));
|
|
|
|
this.lockedControls.push(this.btnConvertRange);
|
|
|
|
|
2020-04-13 09:45:11 +00:00
|
|
|
this.btnRemDuplicates = new Common.UI.Button({
|
2020-07-14 11:27:45 +00:00
|
|
|
parentEl: $('#table-btn-rem-duplicates'),
|
2021-12-04 19:59:28 +00:00
|
|
|
cls : 'btn-toolbar align-left',
|
2020-07-14 11:27:45 +00:00
|
|
|
iconCls : 'toolbar__icon btn-remove-duplicates',
|
|
|
|
caption : this.textRemDuplicates,
|
2021-12-04 19:59:28 +00:00
|
|
|
style : 'width: 100%;',
|
2021-06-08 14:26:10 +00:00
|
|
|
dataHint : '1',
|
|
|
|
dataHintDirection: 'left',
|
|
|
|
dataHintOffset: 'small'
|
2020-04-13 09:45:11 +00:00
|
|
|
});
|
|
|
|
this.btnRemDuplicates.on('click', _.bind(function(btn){
|
|
|
|
Common.NotificationCenter.trigger('data:remduplicates', this);
|
|
|
|
}, this));
|
|
|
|
this.lockedControls.push(this.btnRemDuplicates);
|
|
|
|
|
2020-06-05 10:42:20 +00:00
|
|
|
this.btnSlicer = new Common.UI.Button({
|
2020-07-14 11:27:45 +00:00
|
|
|
parentEl: $('#table-btn-slicer'),
|
2021-12-04 19:59:28 +00:00
|
|
|
cls : 'btn-toolbar align-left',
|
2020-07-14 11:27:45 +00:00
|
|
|
iconCls : 'toolbar__icon btn-slicer',
|
|
|
|
caption : this.textSlicer,
|
2021-12-04 19:59:28 +00:00
|
|
|
style : 'width: 100%;',
|
2021-06-08 14:26:10 +00:00
|
|
|
dataHint : '1',
|
|
|
|
dataHintDirection: 'left',
|
|
|
|
dataHintOffset: 'small'
|
2020-06-05 10:42:20 +00:00
|
|
|
});
|
|
|
|
this.btnSlicer.on('click', _.bind(this.onInsertSlicerClick, this));
|
|
|
|
this.lockedControls.push(this.btnSlicer);
|
|
|
|
|
2020-06-22 13:01:05 +00:00
|
|
|
this.btnPivot = new Common.UI.Button({
|
2020-07-14 11:27:45 +00:00
|
|
|
parentEl: $('#table-btn-pivot'),
|
2021-12-04 19:59:28 +00:00
|
|
|
cls : 'btn-toolbar align-left',
|
2020-07-14 11:27:45 +00:00
|
|
|
iconCls : 'toolbar__icon btn-pivot-sum',
|
|
|
|
caption : this.textPivot,
|
2021-12-04 19:59:28 +00:00
|
|
|
style : 'width: 100%;',
|
2021-06-08 14:26:10 +00:00
|
|
|
dataHint : '1',
|
|
|
|
dataHintDirection: 'left',
|
|
|
|
dataHintOffset: 'small'
|
2020-06-22 13:01:05 +00:00
|
|
|
});
|
|
|
|
this.btnPivot.on('click', _.bind(this.onInsertPivotClick, this));
|
|
|
|
this.lockedControls.push(this.btnPivot);
|
|
|
|
|
|
|
|
this.$el.find('.pivot-only').toggleClass('hidden', !this.mode.canFeaturePivot);
|
|
|
|
|
2017-01-19 11:08:51 +00:00
|
|
|
$(this.el).on('click', '#table-advanced-link', _.bind(this.openAdvancedSettings, this));
|
|
|
|
|
2016-10-12 15:38:10 +00:00
|
|
|
this._initSettings = false;
|
2016-03-29 08:11:58 +00:00
|
|
|
},
|
|
|
|
|
2017-01-19 11:08:51 +00:00
|
|
|
openAdvancedSettings: function(e) {
|
|
|
|
if (this.linkAdvanced.hasClass('disabled')) return;
|
|
|
|
|
|
|
|
var me = this;
|
|
|
|
var win;
|
|
|
|
if (me.api && !this._locked){
|
|
|
|
(new SSE.Views.TableSettingsAdvanced(
|
|
|
|
{
|
|
|
|
tableProps: me._originalProps,
|
|
|
|
api: me.api,
|
|
|
|
handler: function(result, value) {
|
2017-02-07 08:36:15 +00:00
|
|
|
if (result == 'ok' && me.api && value) {
|
|
|
|
me.api.asc_changeFormatTableInfo(me._state.TableName, Asc.c_oAscChangeTableStyleInfo.advancedSettings, value);
|
2017-01-19 11:08:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Common.NotificationCenter.trigger('edit:complete', me);
|
|
|
|
}
|
|
|
|
})).show();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2021-07-19 17:48:36 +00:00
|
|
|
ChangeSettings: function(props, wsLock, wsProps) {
|
2016-10-12 15:38:10 +00:00
|
|
|
if (this._initSettings)
|
2016-08-24 08:44:45 +00:00
|
|
|
this.createDelayedControls();
|
2016-03-29 08:11:58 +00:00
|
|
|
|
2021-07-19 17:48:36 +00:00
|
|
|
this.wsLock = wsLock;
|
|
|
|
this.wsProps = wsProps;
|
2017-04-11 11:05:56 +00:00
|
|
|
this.disableControls(this._locked); // need to update combodataview after disabled state
|
2016-03-29 08:11:58 +00:00
|
|
|
|
2016-03-29 14:35:28 +00:00
|
|
|
if (props )//formatTableInfo
|
2016-03-29 08:11:58 +00:00
|
|
|
{
|
|
|
|
this._originalProps = props;
|
|
|
|
|
2016-03-29 14:35:28 +00:00
|
|
|
var value = props.asc_getTableName();
|
|
|
|
if (this._state.TableName!==value) {
|
|
|
|
this.txtTableName.setValue(value);
|
|
|
|
this._state.TableName=value;
|
|
|
|
}
|
|
|
|
|
2016-03-30 12:27:16 +00:00
|
|
|
this._state.Range = props.asc_getTableRange();
|
|
|
|
|
2016-04-05 12:30:21 +00:00
|
|
|
var needTablePictures = false;
|
2016-03-29 14:35:28 +00:00
|
|
|
value = props.asc_getFirstRow();
|
|
|
|
if (this._state.CheckHeader!==value) {
|
|
|
|
this.chHeader.setValue(value, true);
|
|
|
|
this._state.CheckHeader=value;
|
2016-04-05 12:30:21 +00:00
|
|
|
needTablePictures = true;
|
2016-03-29 14:35:28 +00:00
|
|
|
}
|
2016-03-29 08:11:58 +00:00
|
|
|
|
2016-03-29 14:35:28 +00:00
|
|
|
value = props.asc_getLastRow();
|
|
|
|
if (this._state.CheckTotal!==value) {
|
|
|
|
this.chTotal.setValue(value, true);
|
|
|
|
this._state.CheckTotal=value;
|
2016-04-05 12:30:21 +00:00
|
|
|
needTablePictures = true;
|
2016-03-29 14:35:28 +00:00
|
|
|
}
|
2016-03-29 08:11:58 +00:00
|
|
|
|
2016-03-29 14:35:28 +00:00
|
|
|
value = props.asc_getBandHor();
|
|
|
|
if (this._state.CheckBanded!==value) {
|
|
|
|
this.chBanded.setValue(value, true);
|
|
|
|
this._state.CheckBanded=value;
|
2016-04-05 12:30:21 +00:00
|
|
|
needTablePictures = true;
|
2016-03-29 14:35:28 +00:00
|
|
|
}
|
2016-03-29 08:11:58 +00:00
|
|
|
|
2016-03-29 14:35:28 +00:00
|
|
|
value = props.asc_getFirstCol();
|
|
|
|
if (this._state.CheckFirst!==value) {
|
|
|
|
this.chFirst.setValue(value, true);
|
|
|
|
this._state.CheckFirst=value;
|
2016-04-05 12:30:21 +00:00
|
|
|
needTablePictures = true;
|
2016-03-29 14:35:28 +00:00
|
|
|
}
|
2016-03-29 08:11:58 +00:00
|
|
|
|
2016-03-29 14:35:28 +00:00
|
|
|
value = props.asc_getLastCol();
|
|
|
|
if (this._state.CheckLast!==value) {
|
|
|
|
this.chLast.setValue(value, true);
|
|
|
|
this._state.CheckLast=value;
|
2016-04-05 12:30:21 +00:00
|
|
|
needTablePictures = true;
|
2016-03-29 14:35:28 +00:00
|
|
|
}
|
2016-03-29 08:11:58 +00:00
|
|
|
|
2016-03-29 14:35:28 +00:00
|
|
|
value = props.asc_getBandVer();
|
|
|
|
if (this._state.CheckColBanded!==value) {
|
|
|
|
this.chColBanded.setValue(value, true);
|
|
|
|
this._state.CheckColBanded=value;
|
2016-04-05 12:30:21 +00:00
|
|
|
needTablePictures = true;
|
2016-03-29 14:35:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
value = props.asc_getFilterButton();
|
|
|
|
if (this._state.CheckFilter!==value) {
|
|
|
|
this.chFilter.setValue(value, true);
|
|
|
|
this._state.CheckFilter=value;
|
2016-03-29 08:11:58 +00:00
|
|
|
}
|
2016-05-24 07:05:03 +00:00
|
|
|
if (this.chFilter.isDisabled() !== (!this._state.CheckHeader || this._locked || value===null))
|
2021-07-19 17:48:36 +00:00
|
|
|
this.chFilter.setDisabled(!this._state.CheckHeader || this._locked || value===null || this.wsLock);
|
2016-04-05 12:30:21 +00:00
|
|
|
|
2021-07-20 20:11:48 +00:00
|
|
|
if (needTablePictures || !this.mnuTableTemplatePicker)
|
2016-04-05 12:30:21 +00:00
|
|
|
this.onApiInitTableTemplates(this.api.asc_getTablePictures(props));
|
|
|
|
|
|
|
|
//for table-template
|
|
|
|
value = props.asc_getTableStyleName();
|
|
|
|
if (this._state.TemplateName!==value || this._isTemplatesChanged) {
|
2019-12-13 14:18:11 +00:00
|
|
|
var rec = this.mnuTableTemplatePicker.store.findWhere({
|
2016-04-05 12:30:21 +00:00
|
|
|
name: value
|
|
|
|
});
|
2019-12-13 14:18:11 +00:00
|
|
|
if (!rec) {
|
|
|
|
rec = this.mnuTableTemplatePicker.store.at(0);
|
2016-04-05 12:30:21 +00:00
|
|
|
}
|
2019-12-13 14:18:11 +00:00
|
|
|
this.btnTableTemplate.suspendEvents();
|
|
|
|
this.mnuTableTemplatePicker.selectRecord(rec, true);
|
|
|
|
this.btnTableTemplate.resumeEvents();
|
|
|
|
|
2021-08-16 12:35:40 +00:00
|
|
|
this.$el.find('.icon-template-table').css({'background-image': 'url(' + rec.get("imageUrl") + ')', 'height': '44px', 'width': '60px', 'background-position': 'center', 'background-size': 'cover'});
|
2019-12-13 14:18:11 +00:00
|
|
|
|
2016-04-05 12:30:21 +00:00
|
|
|
this._state.TemplateName=value;
|
|
|
|
}
|
|
|
|
this._isTemplatesChanged = false;
|
2016-03-29 08:11:58 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2016-11-29 12:48:18 +00:00
|
|
|
onSendThemeColors: function() {
|
|
|
|
// get new table templates
|
2020-09-16 21:38:36 +00:00
|
|
|
this.btnTableTemplate && this.onApiInitTableTemplates(this.api.asc_getTablePictures(this._originalProps));
|
2016-11-29 12:48:18 +00:00
|
|
|
},
|
|
|
|
|
2016-03-29 08:11:58 +00:00
|
|
|
onApiInitTableTemplates: function(Templates){
|
|
|
|
var self = this;
|
|
|
|
this._isTemplatesChanged = true;
|
|
|
|
|
2019-12-13 14:18:11 +00:00
|
|
|
if (!this.btnTableTemplate) {
|
|
|
|
this.btnTableTemplate = new Common.UI.Button({
|
2019-12-16 10:55:13 +00:00
|
|
|
cls : 'btn-large-dataview sheet-template-table',
|
2019-12-13 14:18:11 +00:00
|
|
|
iconCls : 'icon-template-table',
|
|
|
|
menu : new Common.UI.Menu({
|
|
|
|
items: [
|
2022-09-14 11:40:47 +00:00
|
|
|
{ template: _.template('<div id="id-table-menu-template" class="menu-table-template" style="margin: 0 4px;"></div>') }
|
2019-12-13 14:18:11 +00:00
|
|
|
]
|
2021-06-08 14:26:10 +00:00
|
|
|
}),
|
|
|
|
dataHint : '1',
|
|
|
|
dataHintDirection: 'bottom',
|
2022-09-14 11:40:47 +00:00
|
|
|
dataHintOffset: 'big',
|
2016-08-24 08:44:45 +00:00
|
|
|
});
|
2019-12-13 14:18:11 +00:00
|
|
|
this.btnTableTemplate.on('render:after', function(btn) {
|
|
|
|
self.mnuTableTemplatePicker = new Common.UI.DataView({
|
|
|
|
el: $('#id-table-menu-template'),
|
|
|
|
parentMenu: btn.menu,
|
2019-12-16 10:55:13 +00:00
|
|
|
restoreHeight: 325,
|
2019-12-13 14:18:11 +00:00
|
|
|
groups: new Common.UI.DataViewGroupStore(),
|
|
|
|
store: new Common.UI.DataViewStore(),
|
2022-09-14 11:40:47 +00:00
|
|
|
itemTemplate: _.template('<div id="<%= id %>" class="item-template"><img src="<%= imageUrl %>" height="44" width="60"></div>'),
|
2021-09-08 15:42:05 +00:00
|
|
|
style: 'max-height: 325px;',
|
|
|
|
delayRenderTips: true
|
2019-12-13 14:18:11 +00:00
|
|
|
});
|
2016-08-24 08:44:45 +00:00
|
|
|
});
|
2022-09-14 11:40:47 +00:00
|
|
|
|
|
|
|
this.btnTableTemplate.menu.on('show:before', function(menu) {
|
|
|
|
if (menu && self.mnuTableTemplatePicker) {
|
|
|
|
var picker = self.mnuTableTemplatePicker,
|
|
|
|
columnCount = 7;
|
|
|
|
|
|
|
|
if (picker.cmpEl) {
|
|
|
|
var itemEl = $(picker.cmpEl.find('.dataview.inner .item-template').get(0)).parent(),
|
|
|
|
itemMargin = 8,
|
|
|
|
itemWidth = itemEl.is(':visible') ? parseFloat(itemEl.css('width')) : 60;
|
|
|
|
|
|
|
|
var menuWidth = columnCount * (itemMargin + itemWidth) + 11, // for scroller
|
|
|
|
menuMargins = parseFloat(picker.cmpEl.css('margin-left')) + parseFloat(picker.cmpEl.css('margin-right'));
|
|
|
|
if (menuWidth + menuMargins>Common.Utils.innerWidth())
|
|
|
|
menuWidth = Math.max(Math.floor((Common.Utils.innerWidth()-menuMargins-11)/(itemMargin + itemWidth)), 2) * (itemMargin + itemWidth) + 11;
|
|
|
|
picker.cmpEl.css({
|
|
|
|
'width': menuWidth
|
|
|
|
});
|
|
|
|
menu.alignPosition();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var scroller = self.mnuTableTemplatePicker.scroller;
|
|
|
|
if (scroller) {
|
|
|
|
scroller.update({alwaysVisibleY: true});
|
|
|
|
scroller.scrollTop(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
var val = self.mnuTableTemplatePicker.store.findWhere({name: self._state.tablestylename});
|
|
|
|
if (val)
|
|
|
|
self.mnuTableTemplatePicker.selectRecord(val);
|
|
|
|
else
|
|
|
|
self.mnuTableTemplatePicker.deselectAll();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2019-12-13 14:18:11 +00:00
|
|
|
this.btnTableTemplate.render($('#table-btn-template'));
|
|
|
|
this.lockedControls.push(this.btnTableTemplate);
|
|
|
|
this.mnuTableTemplatePicker.on('item:click', _.bind(this.onTableTemplateSelect, this, this.btnTableTemplate));
|
2021-07-19 17:48:36 +00:00
|
|
|
if (this._locked) this.btnTableTemplate.setDisabled(this._locked || this.wsProps['FormatCells']);
|
2016-08-24 08:44:45 +00:00
|
|
|
}
|
|
|
|
|
2019-12-13 14:18:11 +00:00
|
|
|
|
|
|
|
var count = self.mnuTableTemplatePicker.store.length;
|
2016-03-29 08:11:58 +00:00
|
|
|
if (count>0 && count==Templates.length) {
|
2020-09-16 13:38:40 +00:00
|
|
|
var data = self.mnuTableTemplatePicker.dataViewItems;
|
|
|
|
data && _.each(Templates, function(template, index){
|
|
|
|
var img = template.asc_getImage();
|
|
|
|
data[index].model.set('imageUrl', img, {silent: true});
|
|
|
|
$(data[index].el).find('img').attr('src', img);
|
2016-03-29 08:11:58 +00:00
|
|
|
});
|
2022-07-22 12:51:54 +00:00
|
|
|
} else {
|
2022-07-23 13:15:32 +00:00
|
|
|
var templates = [];
|
2022-07-22 12:51:54 +00:00
|
|
|
var groups = [
|
2022-07-23 13:15:32 +00:00
|
|
|
{id: 'menu-table-group-custom', caption: self.txtGroupTable_Custom, templates: []},
|
|
|
|
{id: 'menu-table-group-light', caption: self.txtGroupTable_Light, templates: []},
|
|
|
|
{id: 'menu-table-group-medium', caption: self.txtGroupTable_Medium, templates: []},
|
|
|
|
{id: 'menu-table-group-dark', caption: self.txtGroupTable_Dark, templates: []},
|
|
|
|
{id: 'menu-table-group-no-name', caption: ' ', templates: []},
|
2022-07-22 12:51:54 +00:00
|
|
|
];
|
|
|
|
_.each(Templates, function(item){
|
|
|
|
var tip = item.asc_getDisplayName();
|
|
|
|
var groupItem = '';
|
2022-07-23 13:15:32 +00:00
|
|
|
|
2022-07-22 12:51:54 +00:00
|
|
|
if (item.asc_getType()==0) {
|
|
|
|
var arr = tip.split(' '),
|
|
|
|
last = arr.pop();
|
2022-07-23 13:15:32 +00:00
|
|
|
|
|
|
|
if(tip == 'None'){
|
|
|
|
groupItem = 'menu-table-group-light';
|
2022-07-22 12:51:54 +00:00
|
|
|
}
|
2022-07-23 13:15:32 +00:00
|
|
|
else {
|
|
|
|
if(arr.length > 0){
|
|
|
|
groupItem = 'menu-table-group-' + arr[arr.length - 1].toLowerCase();
|
|
|
|
}
|
|
|
|
if(groups.some(function(item) {return item.id === groupItem;}) == false) {
|
|
|
|
groupItem = 'menu-table-group-no-name';
|
|
|
|
}
|
2022-07-22 12:51:54 +00:00
|
|
|
}
|
|
|
|
arr = 'txtTable_' + arr.join('');
|
|
|
|
tip = self[arr] ? self[arr] + ' ' + last : tip;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
groupItem = 'menu-table-group-custom'
|
|
|
|
}
|
2022-07-23 13:15:32 +00:00
|
|
|
groups.filter(function(item){ return item.id == groupItem; })[0].templates.push({
|
2016-03-29 08:11:58 +00:00
|
|
|
id : Common.UI.getId(),
|
2022-07-22 12:51:54 +00:00
|
|
|
name : item.asc_getName(),
|
|
|
|
caption : item.asc_getDisplayName(),
|
|
|
|
type : item.asc_getType(),
|
|
|
|
imageUrl : item.asc_getImage(),
|
|
|
|
group : groupItem,
|
2016-03-29 08:11:58 +00:00
|
|
|
allowSelected : true,
|
2016-11-29 12:01:29 +00:00
|
|
|
selected : false,
|
2022-07-22 12:51:54 +00:00
|
|
|
tip : tip
|
2016-03-29 08:11:58 +00:00
|
|
|
});
|
|
|
|
});
|
2022-07-23 13:15:32 +00:00
|
|
|
|
|
|
|
groups = groups.filter(function(item, index){
|
|
|
|
return item.templates.length > 0
|
|
|
|
});
|
|
|
|
|
|
|
|
groups.forEach(function(item){
|
|
|
|
templates = templates.concat(item.templates);
|
|
|
|
delete item.templates;
|
|
|
|
});
|
2022-07-22 12:51:54 +00:00
|
|
|
|
|
|
|
self.mnuTableTemplatePicker.groups.reset(groups);
|
2022-07-23 13:15:32 +00:00
|
|
|
self.mnuTableTemplatePicker.store.reset(templates);
|
2016-03-29 08:11:58 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
onSelectData: function() {
|
|
|
|
var me = this;
|
|
|
|
if (me.api) {
|
|
|
|
var handlerDlg = function(dlg, result) {
|
|
|
|
if (result == 'ok') {
|
2016-04-08 11:20:34 +00:00
|
|
|
me.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.None);
|
2017-04-11 11:05:56 +00:00
|
|
|
|
|
|
|
var settings = dlg.getSettings();
|
|
|
|
if (settings.selectionType == Asc.c_oAscSelectionType.RangeMax || settings.selectionType == Asc.c_oAscSelectionType.RangeRow ||
|
|
|
|
settings.selectionType == Asc.c_oAscSelectionType.RangeCol)
|
|
|
|
Common.UI.warning({
|
|
|
|
title: me.textLongOperation,
|
|
|
|
msg: me.warnLongOperation,
|
|
|
|
buttons: ['ok', 'cancel'],
|
|
|
|
callback: function(btn) {
|
|
|
|
if (btn == 'ok')
|
|
|
|
setTimeout(function() { me.api.asc_changeTableRange(me._state.TableName, settings.range)}, 1);
|
|
|
|
Common.NotificationCenter.trigger('edit:complete', me);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
else
|
|
|
|
me.api.asc_changeTableRange(me._state.TableName, settings.range);
|
2016-03-29 08:11:58 +00:00
|
|
|
}
|
|
|
|
|
2017-04-11 11:05:56 +00:00
|
|
|
Common.NotificationCenter.trigger('edit:complete', me);
|
2016-03-29 08:11:58 +00:00
|
|
|
};
|
|
|
|
var win = new SSE.Views.TableOptionsDialog({
|
|
|
|
handler: handlerDlg
|
|
|
|
});
|
|
|
|
|
|
|
|
win.show();
|
|
|
|
win.setSettings({
|
2016-04-05 14:03:04 +00:00
|
|
|
api : me.api,
|
2016-04-07 11:17:47 +00:00
|
|
|
range : me._state.Range,
|
|
|
|
title: me.textResize
|
2016-03-29 08:11:58 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
2018-06-13 15:43:52 +00:00
|
|
|
|
2020-06-05 10:42:20 +00:00
|
|
|
onInsertSlicerClick: function() {
|
|
|
|
var me = this,
|
|
|
|
props = me.api.asc_beforeInsertSlicer();
|
|
|
|
if (props) {
|
|
|
|
(new SSE.Views.SlicerAddDialog({
|
|
|
|
props: props,
|
|
|
|
handler: function (result, settings) {
|
|
|
|
if (me && me.api && result == 'ok') {
|
|
|
|
me.api.asc_insertSlicer(settings);
|
|
|
|
}
|
|
|
|
Common.NotificationCenter.trigger('edit:complete', me);
|
|
|
|
}
|
|
|
|
})).show();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2020-06-22 13:01:05 +00:00
|
|
|
onInsertPivotClick: function() {
|
|
|
|
this.fireEvent('pivottable:create');
|
|
|
|
},
|
|
|
|
|
2018-06-13 15:43:52 +00:00
|
|
|
onApiEditCell: function(state) {
|
|
|
|
this.isEditCell = (state != Asc.c_oAscCellEditorState.editEnd);
|
|
|
|
if ( state == Asc.c_oAscCellEditorState.editStart || state == Asc.c_oAscCellEditorState.editEnd)
|
|
|
|
this.disableControls(this._locked);
|
|
|
|
},
|
|
|
|
|
2016-03-29 08:11:58 +00:00
|
|
|
setLocked: function (locked) {
|
|
|
|
this._locked = locked;
|
|
|
|
},
|
|
|
|
|
|
|
|
disableControls: function(disable) {
|
2016-08-24 08:44:45 +00:00
|
|
|
if (this._initSettings) return;
|
2018-06-13 15:43:52 +00:00
|
|
|
disable = disable || this.isEditCell;
|
|
|
|
|
2021-07-19 17:48:36 +00:00
|
|
|
var me = this;
|
|
|
|
_.each(this.lockedControls, function(item) {
|
|
|
|
item.setDisabled(disable || me.wsLock);
|
|
|
|
});
|
|
|
|
this.linkAdvanced.toggleClass('disabled', disable || this.wsLock);
|
|
|
|
this.btnTableTemplate && this.btnTableTemplate.setDisabled(disable || this.wsProps['FormatCells']);
|
|
|
|
this.chBanded.setDisabled(disable || this.wsProps['FormatCells']);
|
|
|
|
this.chFirst.setDisabled(disable || this.wsProps['FormatCells']);
|
|
|
|
this.chLast.setDisabled(disable || this.wsProps['FormatCells']);
|
|
|
|
this.chColBanded.setDisabled(disable || this.wsProps['FormatCells']);
|
2016-03-29 08:11:58 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
textEdit: 'Rows & Columns',
|
|
|
|
selectRowText : 'Select Row',
|
2016-03-29 14:35:28 +00:00
|
|
|
selectColumnText : 'Select Entire Column',
|
|
|
|
selectDataText : 'Select Column Data',
|
2016-03-29 08:11:58 +00:00
|
|
|
selectTableText : 'Select Table',
|
|
|
|
insertRowAboveText : 'Insert Row Above',
|
|
|
|
insertRowBelowText : 'Insert Row Below',
|
|
|
|
insertColumnLeftText : 'Insert Column Left',
|
|
|
|
insertColumnRightText : 'Insert Column Right',
|
|
|
|
deleteRowText : 'Delete Row',
|
|
|
|
deleteColumnText : 'Delete Column',
|
|
|
|
deleteTableText : 'Delete Table',
|
|
|
|
textTemplate : 'Select From Template',
|
|
|
|
textRows : 'Rows',
|
|
|
|
textColumns : 'Columns',
|
|
|
|
textHeader : 'Header',
|
|
|
|
textTotal : 'Total',
|
|
|
|
textBanded : 'Banded',
|
|
|
|
textFirst : 'First',
|
|
|
|
textLast : 'Last',
|
|
|
|
textEmptyTemplate : 'No templates',
|
|
|
|
textFilter : 'Filter button',
|
|
|
|
textTableName : 'Table Name',
|
|
|
|
textResize : 'Resize table',
|
2016-03-30 12:27:16 +00:00
|
|
|
textSelectData : 'Select Data',
|
2016-03-30 14:29:35 +00:00
|
|
|
textInvalidName : 'ERROR! Invalid table name',
|
2016-03-30 12:27:16 +00:00
|
|
|
textExistName : 'ERROR! Range with such a name already exists',
|
|
|
|
textIsLocked : 'This element is being edited by another user.',
|
|
|
|
notcriticalErrorTitle : 'Warning',
|
2017-01-19 11:08:51 +00:00
|
|
|
textReservedName : 'The name you are trying to use is already referenced in cell formulas. Please use some other name.',
|
2017-04-11 11:05:56 +00:00
|
|
|
textAdvanced: 'Show advanced settings',
|
|
|
|
textConvertRange: 'Convert to range',
|
|
|
|
textLongOperation: 'Long operation',
|
2020-04-13 09:45:11 +00:00
|
|
|
warnLongOperation: 'The operation you are about to perform might take rather much time to complete.<br>Are you sure you want to continue?',
|
2020-06-05 10:42:20 +00:00
|
|
|
textRemDuplicates: 'Remove duplicates',
|
2020-06-22 13:01:05 +00:00
|
|
|
textSlicer: 'Insert slicer',
|
2020-07-14 11:27:45 +00:00
|
|
|
textPivot: 'Insert pivot table',
|
2022-07-22 12:51:54 +00:00
|
|
|
textActions: 'Table actions',
|
|
|
|
txtTable_TableStyleMedium: 'Table Style Medium',
|
|
|
|
txtTable_TableStyleDark: 'Table Style Dark',
|
|
|
|
txtTable_TableStyleLight: 'Table Style Light',
|
|
|
|
txtGroupTable_Custom: 'Custom',
|
|
|
|
txtGroupTable_Light: 'Light',
|
|
|
|
txtGroupTable_Medium: 'Medium',
|
|
|
|
txtGroupTable_Dark: 'Dark',
|
|
|
|
|
2020-06-22 13:01:05 +00:00
|
|
|
|
2016-03-29 08:11:58 +00:00
|
|
|
}, SSE.Views.TableSettings || {}));
|
|
|
|
});
|