[SSE] Add print gridlines and print headings in toolbar

This commit is contained in:
JuliaSvinareva 2021-10-21 19:52:17 +03:00
parent 79bf7d21bb
commit bd079d4209
3 changed files with 45 additions and 3 deletions

View file

@ -396,6 +396,8 @@ define([
button.on('click', _.bind(me.onEditHeaderClick, me));
});
toolbar.btnPrintTitles.on('click', _.bind(this.onPrintTitlesClick, this));
toolbar.chPrintGridlines.on('change', _.bind(this.onPrintGridlinesChange, this));
toolbar.chPrintHeadings.on('change', _.bind(this.onPrintHeadingsChange, this));
if (toolbar.btnCondFormat.rendered) {
toolbar.btnCondFormat.menu.on('show:before', _.bind(this.onShowBeforeCondFormat, this, this.toolbar, 'toolbar'));
}
@ -4063,6 +4065,16 @@ define([
}
},
onPrintGridlinesChange: function (field, value) { // To Do
console.log(value);
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
},
onPrintHeadingsChange: function (field, value) { // To Do
console.log(value);
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
},
textEmptyImgUrl : 'You need to specify image URL.',
warnMergeLostData : 'Operation can destroy data in the selected cells.<br>Continue?',
textWarning : 'Warning',

View file

@ -162,6 +162,15 @@
<span class="btn-slot text x-huge" id="slot-btn-printtitles"></span>
</div>
<div class="separator long"></div>
<div class="group small">
<div class="elset">
<span class="btn-slot text" id="slot-chk-print-gridlines"></span>
</div>
<div class="elset">
<span class="btn-slot text" id="slot-chk-print-headings"></span>
</div>
</div>
<div class="separator long"></div>
<div class="group">
<span class="btn-slot text x-huge" id="slot-img-align"></span>
<span class="btn-slot text x-huge" id="slot-img-group"></span>

View file

@ -1567,6 +1567,22 @@ define([
dataHintOffset: 'small'
});
me.chPrintGridlines = new Common.UI.CheckBox({
labelText: this.textPrintGridlines,
lock: [_set.selRange, _set.selRangeEdit, _set.lostConnect, _set.coAuth, _set.coAuthText, _set["Objects"]],
dataHint: '1',
dataHintDirection: 'left',
dataHintOffset: 'small'
});
me.chPrintHeadings = new Common.UI.CheckBox({
labelText: this.textPrintHeadings,
lock: [_set.selRange, _set.selRangeEdit, _set.lostConnect, _set.coAuth, _set.coAuthText, _set["Objects"]],
dataHint: '1',
dataHintDirection: 'left',
dataHintOffset: 'small'
});
me.btnImgAlign = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-img-align',
@ -1634,7 +1650,8 @@ define([
me.btnInsertChart, me.btnColorSchemas, me.btnInsertSparkline,
me.btnCopy, me.btnPaste, me.listStyles, me.btnPrint,
/*me.btnSave,*/ me.btnClearStyle, me.btnCopyStyle,
me.btnPageMargins, me.btnPageSize, me.btnPageOrient, me.btnPrintArea, me.btnPrintTitles, me.btnImgAlign, me.btnImgBackward, me.btnImgForward, me.btnImgGroup, me.btnScale
me.btnPageMargins, me.btnPageSize, me.btnPageOrient, me.btnPrintArea, me.btnPrintTitles, me.btnImgAlign, me.btnImgBackward, me.btnImgForward, me.btnImgGroup, me.btnScale,
me.chPrintGridlines, me.chPrintHeadings
];
_.each(me.lockControls.concat([me.btnSave]), function(cmp) {
@ -1840,7 +1857,9 @@ define([
_injectComponent('#slot-btn-pagemargins', this.btnPageMargins);
_injectComponent('#slot-btn-pagesize', this.btnPageSize);
_injectComponent('#slot-btn-printarea', this.btnPrintArea);
_injectComponent('#slot-btn-printtitles', this.btnPrintTitles);
_injectComponent('#slot-btn-printtitles', this.btnPrintTitles);
_injectComponent('#slot-chk-print-gridlines', this.chPrintGridlines);
_injectComponent('#slot-chk-print-headings', this.chPrintHeadings);
_injectComponent('#slot-img-align', this.btnImgAlign);
_injectComponent('#slot-img-group', this.btnImgGroup);
_injectComponent('#slot-img-movefrwd', this.btnImgForward);
@ -2850,6 +2869,8 @@ define([
textItems: 'Items',
tipInsertSpark: 'Insert sparkline',
capInsertSpark: 'Sparklines',
txtScheme22: 'New Office'
txtScheme22: 'New Office',
textPrintGridlines: 'Print gridlines',
textPrintHeadings: 'Print headings'
}, SSE.Views.Toolbar || {}));
});