[SSE] Add api methods for gridlines and headings

This commit is contained in:
JuliaSvinareva 2021-10-27 14:11:23 +03:00
parent 7cc2f854e8
commit ac93b3b4f2

View file

@ -2252,6 +2252,8 @@ define([
this.onApiPageSize(opt.asc_getWidth(), opt.asc_getHeight()); this.onApiPageSize(opt.asc_getWidth(), opt.asc_getHeight());
this.onApiPageMargins(props.asc_getPageMargins()); this.onApiPageMargins(props.asc_getPageMargins());
this.onChangeScaleSettings(opt.asc_getFitToWidth(),opt.asc_getFitToHeight(),opt.asc_getScale()); this.onChangeScaleSettings(opt.asc_getFitToWidth(),opt.asc_getFitToHeight(),opt.asc_getScale());
this.onApiGridLines(props.asc_getGridLines());
this.onApiHeadings(props.asc_getHeadings());
this.api.asc_isLayoutLocked(currentSheet) ? this.onApiLockDocumentProps(currentSheet) : this.onApiUnLockDocumentProps(currentSheet); this.api.asc_isLayoutLocked(currentSheet) ? this.onApiLockDocumentProps(currentSheet) : this.onApiUnLockDocumentProps(currentSheet);
this.toolbar.lockToolbar(SSE.enumLock.printAreaLock, this.api.asc_isPrintAreaLocked(currentSheet), {array: [this.toolbar.btnPrintArea]}); this.toolbar.lockToolbar(SSE.enumLock.printAreaLock, this.api.asc_isPrintAreaLocked(currentSheet), {array: [this.toolbar.btnPrintArea]});
@ -2262,6 +2264,14 @@ define([
this.onApiSheetChanged(); this.onApiSheetChanged();
}, },
onApiGridLines: function (checked) {
this.toolbar.chPrintGridlines.setValue(checked, true);
},
onApiHeadings: function (checked) {
this.toolbar.chPrintHeadings.setValue(checked, true);
},
onApiPageSize: function(w, h) { onApiPageSize: function(w, h) {
if (this._state.pgorient===undefined) return; if (this._state.pgorient===undefined) return;
@ -4065,13 +4075,13 @@ define([
} }
}, },
onPrintGridlinesChange: function (field, value) { // To Do onPrintGridlinesChange: function (field, value) {
console.log(value); this.api.asc_SetPrintGridlines(value === 'checked');
Common.NotificationCenter.trigger('edit:complete', this.toolbar); Common.NotificationCenter.trigger('edit:complete', this.toolbar);
}, },
onPrintHeadingsChange: function (field, value) { // To Do onPrintHeadingsChange: function (field, value) {
console.log(value); this.api.asc_SetPrintHeadings(value === 'checked');
Common.NotificationCenter.trigger('edit:complete', this.toolbar); Common.NotificationCenter.trigger('edit:complete', this.toolbar);
}, },