12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- var Unibase;
- (function (Unibase) {
- let Forms;
- (function (Forms) {
- let Controls;
- (function (Controls) {
- class RadioBox_Settings {
- loadSettingHtml(Container) {
- var html = `<section class="card"><div class="b-b bg-white card-header"><strong class="text-dark Title" id="cpheader">Radio Button Setting</strong></div><div class="card-body"><div class="row">
- <div class="col-sm-12"><ul class="list-group list-group-flush radioOptions font-14 m-t-n-md ui-sortable" id="radioOptions"></ul></div></div><div class="row"><div class="col-sm-6" id="divRadioList">
- <div class="divRadioList"><a href="javascript:" class="btn btn-primary" onclick="Unibase.Platform.Forms.Components.ControlEditor.Instance().AddRadioOptions(0)">Add New Radio Button</a>
- </div></div></div></div></section>`;
- $(Container).html(html);
- }
- bindControlData(controldatajson) {
- Unibase.Platform.Forms.Components.ControlEditor.Instance().getControlOptions(controldatajson);
- }
- SaveControlData(controldatajson) {
- var arr = [];
- $(".option-group").each(function () {
- var data = {
- DropDownColumnId: Number($(this).find(".hdnRdbId").val()),
- ColumnText: $(this).find(".rdbText").val(),
- ColumnValue: $(this).find(".rdbValue").val(),
- DocPropertyId: Number(Unibase.Platform.Forms.Components.PropertyEditor.Instance().DocPropertyId),
- ControlId: Unibase.Platform.Forms.Components.ControlEditor.Instance().ControlId,
- IndexNumber: $(this).index() + 1,
- };
- arr.push(data);
- });
- controldatajson = JSON.stringify(arr);
- return controldatajson;
- }
- loadControlPropertiesHtml(Container) {
- var html = `<section class="">` +
- `<div class="card PropertySettings">` +
- `<div class="card-header"><h6><b>Property Settings</b></h6></div>` +
- `<div class="card-body" id="divPropSetting"><div class="row"><div class="col-sm-6 Controlproperties-Element" data-propertysettingid="0" data-controlpropertyid="0" data-controlpropertyname="IsTabView"><label for="IsTabView" style="margin-top:19px"><b>IsTabView</b></label><label id="lblIsTabView" class="switch m-t form-inline pull-right mt-10" style="color:grey"><input id="IsTabView" data-group="IsRequired" type="checkbox"><span></span></label></div></div></div>` +
- `</div></section>`;
- $(Container).html(html);
- $("#divPropSetting").removeClass('hidden');
- }
- bindPropertySettings(prop) {
- var propertySettings = prop.PropertySettings;
- if (propertySettings != null && propertySettings != undefined) {
- var i = 0;
- $(".Controlproperties-Element").each(function () {
- if (propertySettings[i].ControlPropertyName == "IsTabView") {
- $(this).attr("data-controlpropertyid", propertySettings[i].ControlPropertyId);
- $(this).attr("data-controlpropertyname", propertySettings[i].ControlPropertyName);
- $(this).attr("data-propertysettingid", propertySettings[i].PropertySettingId);
- if (propertySettings[i].ControlPropertyValue == "true") {
- $("#IsTabView").prop("checked", true);
- }
- else {
- $("#IsTabView").prop("checked", false);
- }
- }
- i += 1;
- });
- }
- }
- savePropertySettings(prop) {
- var propertySettings = prop.PropertySettings;
- var propSettingReq = [];
- $(".Controlproperties-Element").each(function () {
- var data = {
- FormPropertyId: Number(prop.FormPropertyId),
- ControlPropertyId: Number($(this).attr("data-controlpropertyid")),
- ControlPropertyValue: $(this).children().find("input").prop("checked").toString(),
- ControlPropertyName: $(this).attr("data-controlpropertyname"),
- ControlId: Number(prop.ControlId),
- PropertySettingId: Number($(this).attr("data-propertysettingid")),
- };
- propSettingReq.push(data);
- });
- return propSettingReq;
- }
- static Instance() {
- if (this._instance === undefined)
- this._instance = new RadioBox_Settings();
- return this._instance;
- }
- }
- Controls.RadioBox_Settings = RadioBox_Settings;
- })(Controls = Forms.Controls || (Forms.Controls = {}));
- })(Forms = Unibase.Forms || (Unibase.Forms = {}));
- })(Unibase || (Unibase = {}));
|