From 8494d1b752a6acdb83c293270feb64b8264f9d4c Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 30 Sep 2020 17:26:06 +0300 Subject: [PATCH] [DE] Support key for fields and group key for radio box --- .../main/app/view/FormSettings.js | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/apps/documenteditor/main/app/view/FormSettings.js b/apps/documenteditor/main/app/view/FormSettings.js index f083d3484..1915771f4 100644 --- a/apps/documenteditor/main/app/view/FormSettings.js +++ b/apps/documenteditor/main/app/view/FormSettings.js @@ -526,11 +526,21 @@ define([ if (formPr) { this._originalFormProps = formPr; + var data = []; + if (type == Asc.c_oAscContentControlSpecificType.CheckBox) + data = this.api.asc_GetCheckBoxFormKeys(); + else if (type == Asc.c_oAscContentControlSpecificType.Picture) + data = this.api.asc_GetPictureFormKeys(); + else + data = this.api.asc_GetTextFormKeys(); + var arr = []; + data.forEach(function(item) { + arr.push({ displayValue: item, value: item }); + }); + this.cmbKey.setData(arr); + val = formPr.get_Key(); - if (this._state.key!==val) { - this.cmbKey.setValue(val ? val : ''); - this._state.key = val; - } + this.cmbKey.setValue(val ? val : ''); val = formPr.get_HelpText(); if (this._state.help!==val) { @@ -538,16 +548,20 @@ define([ this._state.help=val; } - var hidden = true; if (type == Asc.c_oAscContentControlSpecificType.CheckBox && specProps) { val = specProps.get_GroupKey(); - if (this._state.groupkey!==val) { + var ischeckbox = (typeof val !== 'string'); + if (!ischeckbox) { + var arr = []; + this.api.asc_GetRadioButtonGroupKeys().forEach(function(item) { + arr.push({ displayValue: item, value: item }); + }); + this.cmbGroupKey.setData(arr); this.cmbGroupKey.setValue(val ? val : ''); - this._state.groupkey=val; } - hidden = (typeof val !== 'string'); - this.labelFormName.text(hidden ? this.textCheckbox : this.textRadiobox); - this.chSelected.setCaption(hidden ? this.textChecked : this.textSelected); + + this.labelFormName.text(ischeckbox ? this.textCheckbox : this.textRadiobox); + this.chSelected.setCaption(ischeckbox ? this.textChecked : this.textSelected); val = specProps.get_Checked(); if ( this._state.Selected!==val ) { this.chSelected.setValue(!!val, true);