[PDF] Add readonly form option

This commit is contained in:
Julia.Radzhabova
2025-04-24 13:36:46 +03:00
parent e230c9fa24
commit 0da826f579
3 changed files with 29 additions and 0 deletions

View File

@ -291,6 +291,11 @@
<div id="form-chb-required"></div>
</td>
</tr>
<tr>
<td class="padding-small">
<div id="form-chb-readonly"></div>
</td>
</tr>
<tr class="form-text-combo">
<td class="padding-small">
<div class="separator horizontal"></div>

View File

@ -136,6 +136,16 @@ define([
this.chRequired.on('change', this.onChRequired.bind(this));
this.lockedControls.push(this.chRequired);
this.chReadonly = new Common.UI.CheckBox({
el: $markup.findById('#form-chb-readonly'),
labelText: this.textReadonly,
dataHint: '1',
dataHintDirection: 'left',
dataHintOffset: 'small'
});
this.chReadonly.on('change', this.onChReadonly.bind(this));
this.lockedControls.push(this.chReadonly);
this.cmbLineWidth = new Common.UI.ComboBox({
el: $markup.findById('#form-combo-line-width'),
cls: 'input-group-nr',
@ -770,6 +780,13 @@ define([
}
},
onChReadonly: function(field, newValue, oldValue, eOpts){
if (this.api && !this._noApply) {
this.api.SetFieldReadOnly(field.getValue()==='checked');
this.fireEvent('editcomplete', this);
}
},
onColorBGSelect: function(btn, color) {
this.BackgroundColor = color;
this._state.BackgroundColor = undefined;
@ -1247,6 +1264,12 @@ define([
this._state.Required=val;
}
val = props.asc_getReadOnly();
if ( this._state.Readonly!==val ) {
this.chReadonly.setValue(!!val, true);
this._state.Readonly=val;
}
var color = props.asc_getStroke();
if (color) {
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {

View File

@ -1416,6 +1416,7 @@
"PDFE.Views.FormSettings.textColor": "Color",
"PDFE.Views.FormSettings.textBackgroundColor": "Background color",
"PDFE.Views.FormSettings.textRequired": "Required",
"PDFE.Views.FormSettings.textReadonly": "Read only",
"PDFE.Views.FormSettings.textNoBorder": "No border",
"PDFE.Views.FormSettings.textNoFill": "No fill",
"PDFE.Views.FormSettings.textThin": "Thin",