[DE] Add required option for form settings
This commit is contained in:
parent
c44a6d4b99
commit
fa803d0f4a
|
@ -34,6 +34,11 @@
|
||||||
<div id="form-txt-help"></div>
|
<div id="form-txt-help"></div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<!--<tr class="form-textfield">-->
|
||||||
|
<!--<td class="padding-small">-->
|
||||||
|
<!--<div id="form-chb-fixed"></div>-->
|
||||||
|
<!--</td>-->
|
||||||
|
<!--</tr>-->
|
||||||
<tr class="form-textfield">
|
<tr class="form-textfield">
|
||||||
<td class="padding-small">
|
<td class="padding-small">
|
||||||
<div id="form-chb-max-chars" style="display: inline-block;margin-top: 4px;"></div>
|
<div id="form-chb-max-chars" style="display: inline-block;margin-top: 4px;"></div>
|
||||||
|
@ -52,11 +57,16 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="form-textfield">
|
<tr class="form-textfield">
|
||||||
<td class="padding-large">
|
<td class="padding-small">
|
||||||
<label class="input-label" style="margin-left: 22px;margin-top: 4px;"><%= scope.textColor %></label>
|
<label class="input-label" style="margin-left: 22px;margin-top: 4px;"><%= scope.textColor %></label>
|
||||||
<div id="form-color-btn" style="display: inline-block; float: right;"></div>
|
<div id="form-color-btn" style="display: inline-block; float: right;"></div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr class="form-textfield">
|
||||||
|
<td class="padding-large">
|
||||||
|
<div id="form-chb-required"></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr class="form-image">
|
<tr class="form-image">
|
||||||
<td class="padding-large">
|
<td class="padding-large">
|
||||||
<div id="form-button-replace" style="width:100%;"></div>
|
<div id="form-button-replace" style="width:100%;"></div>
|
||||||
|
|
|
@ -189,6 +189,20 @@ define([
|
||||||
this.spnWidth.on('change', this.onWidthChange.bind(this));
|
this.spnWidth.on('change', this.onWidthChange.bind(this));
|
||||||
this.spnWidth.on('inputleave', function(){ me.fireEvent('editcomplete', me);});
|
this.spnWidth.on('inputleave', function(){ me.fireEvent('editcomplete', me);});
|
||||||
|
|
||||||
|
this.chRequired = new Common.UI.CheckBox({
|
||||||
|
el: $markup.findById('#form-chb-required'),
|
||||||
|
labelText: this.textRequired
|
||||||
|
});
|
||||||
|
this.chRequired.on('change', this.onChRequired.bind(this));
|
||||||
|
this.lockedControls.push(this.chRequired);
|
||||||
|
|
||||||
|
this.chFixed = new Common.UI.CheckBox({
|
||||||
|
el: $markup.findById('#form-chb-fixed'),
|
||||||
|
labelText: this.textFixed
|
||||||
|
});
|
||||||
|
this.chFixed.on('change', this.onChFixed.bind(this));
|
||||||
|
this.lockedControls.push(this.chFixed);
|
||||||
|
|
||||||
// Radio props
|
// Radio props
|
||||||
this.cmbGroupKey = new Common.UI.ComboBox({
|
this.cmbGroupKey = new Common.UI.ComboBox({
|
||||||
el: $markup.findById('#form-combo-group-key'),
|
el: $markup.findById('#form-combo-group-key'),
|
||||||
|
@ -432,6 +446,30 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onChRequired: function(field, newValue, oldValue, eOpts){
|
||||||
|
var checked = (field.getValue()=='checked');
|
||||||
|
if (this.api && !this._noApply) {
|
||||||
|
var props = this._originalProps || new AscCommon.CContentControlPr();
|
||||||
|
var formPr = this._originalFormProps || new AscCommon.CSdtFormPr();
|
||||||
|
formPr.put_Required(checked);
|
||||||
|
props.put_FormPr(formPr);
|
||||||
|
this.api.asc_SetContentControlProperties(props, this.internalId);
|
||||||
|
this.fireEvent('editcomplete', this);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onChFixed: function(field, newValue, oldValue, eOpts){
|
||||||
|
var checked = (field.getValue()=='checked');
|
||||||
|
if (this.api && !this._noApply) {
|
||||||
|
var props = this._originalProps || new AscCommon.CContentControlPr();
|
||||||
|
var formTextPr = this._originalTextFormProps || new AscCommon.CSdtTextFormPr();
|
||||||
|
formTextPr.put_FixedSize(checked);
|
||||||
|
props.put_TextFormPr(formTextPr);
|
||||||
|
this.api.asc_SetContentControlProperties(props, this.internalId);
|
||||||
|
this.fireEvent('editcomplete', this);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
onGroupKeyChanged: function(combo, record) {
|
onGroupKeyChanged: function(combo, record) {
|
||||||
if (this.api && !this._noApply) {
|
if (this.api && !this._noApply) {
|
||||||
var props = this._originalProps || new AscCommon.CContentControlPr();
|
var props = this._originalProps || new AscCommon.CContentControlPr();
|
||||||
|
@ -679,6 +717,12 @@ define([
|
||||||
this._state.help=val;
|
this._state.help=val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val = formPr.get_Required();
|
||||||
|
if ( this._state.Required!==val ) {
|
||||||
|
this.chRequired.setValue(!!val, true);
|
||||||
|
this._state.Required=val;
|
||||||
|
}
|
||||||
|
|
||||||
if (type == Asc.c_oAscContentControlSpecificType.CheckBox && specProps) {
|
if (type == Asc.c_oAscContentControlSpecificType.CheckBox && specProps) {
|
||||||
val = specProps.get_GroupKey();
|
val = specProps.get_GroupKey();
|
||||||
var ischeckbox = (typeof val !== 'string');
|
var ischeckbox = (typeof val !== 'string');
|
||||||
|
@ -713,6 +757,12 @@ define([
|
||||||
this.chComb.setValue(!!val, true);
|
this.chComb.setValue(!!val, true);
|
||||||
this._state.Comb=val;
|
this._state.Comb=val;
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
// val = formTextPr.get_FixedSize();
|
||||||
|
// if ( this._state.Fixed!==val ) {
|
||||||
|
// this.chFixed.setValue(!!val, true);
|
||||||
|
// this._state.Fixed=val;
|
||||||
|
// }
|
||||||
|
|
||||||
this.btnColor.setDisabled(!val);
|
this.btnColor.setDisabled(!val);
|
||||||
|
|
||||||
|
@ -915,7 +965,9 @@ define([
|
||||||
textColor: 'Border color',
|
textColor: 'Border color',
|
||||||
textConnected: 'Fields connected',
|
textConnected: 'Fields connected',
|
||||||
textDisconnect: 'Disconnect',
|
textDisconnect: 'Disconnect',
|
||||||
textNoBorder: 'No border'
|
textNoBorder: 'No border',
|
||||||
|
textFixed: 'Fixed size field',
|
||||||
|
textRequired: 'Required'
|
||||||
|
|
||||||
}, DE.Views.FormSettings || {}));
|
}, DE.Views.FormSettings || {}));
|
||||||
});
|
});
|
|
@ -1766,6 +1766,8 @@
|
||||||
"DE.Views.FormSettings.textUnlock": "Unlock",
|
"DE.Views.FormSettings.textUnlock": "Unlock",
|
||||||
"DE.Views.FormSettings.textValue": "Value Options",
|
"DE.Views.FormSettings.textValue": "Value Options",
|
||||||
"DE.Views.FormSettings.textWidth": "Cell width",
|
"DE.Views.FormSettings.textWidth": "Cell width",
|
||||||
|
"DE.Views.FormSettings.textFixed": "Fixed size field",
|
||||||
|
"DE.Views.FormSettings.textRequired": "Required",
|
||||||
"DE.Views.FormsTab.capBtnCheckBox": "Checkbox",
|
"DE.Views.FormsTab.capBtnCheckBox": "Checkbox",
|
||||||
"DE.Views.FormsTab.capBtnComboBox": "Combo Box",
|
"DE.Views.FormsTab.capBtnComboBox": "Combo Box",
|
||||||
"DE.Views.FormsTab.capBtnDropDown": "Dropdown",
|
"DE.Views.FormsTab.capBtnDropDown": "Dropdown",
|
||||||
|
|
Loading…
Reference in a new issue