Built files from Bizgaze WebServer
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

radiobox.setting.js 5.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. var Unibase;
  2. (function (Unibase) {
  3. let Forms;
  4. (function (Forms) {
  5. let Controls;
  6. (function (Controls) {
  7. class RadioBox_Settings {
  8. loadSettingHtml(Container) {
  9. 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">
  10. <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">
  11. <div class="divRadioList"><a href="javascript:" class="btn btn-primary" onclick="Unibase.Platform.Forms.Components.ControlEditor.Instance().AddRadioOptions(0)">Add New Radio Button</a>
  12. </div></div></div></div></section>`;
  13. $(Container).html(html);
  14. }
  15. bindControlData(controldatajson) {
  16. Unibase.Platform.Forms.Components.ControlEditor.Instance().getControlOptions(controldatajson);
  17. }
  18. SaveControlData(controldatajson) {
  19. var arr = [];
  20. $(".option-group").each(function () {
  21. var data = {
  22. DropDownColumnId: Number($(this).find(".hdnRdbId").val()),
  23. ColumnText: $(this).find(".rdbText").val(),
  24. ColumnValue: $(this).find(".rdbValue").val(),
  25. DocPropertyId: Number(Unibase.Platform.Forms.Components.PropertyEditor.Instance().DocPropertyId),
  26. ControlId: Unibase.Platform.Forms.Components.ControlEditor.Instance().ControlId,
  27. IndexNumber: $(this).index() + 1,
  28. };
  29. arr.push(data);
  30. });
  31. controldatajson = JSON.stringify(arr);
  32. return controldatajson;
  33. }
  34. loadControlPropertiesHtml(Container) {
  35. var html = `<section class="">` +
  36. `<div class="card PropertySettings">` +
  37. `<div class="card-header"><h6><b>Property Settings</b></h6></div>` +
  38. `<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>` +
  39. `</div></section>`;
  40. $(Container).html(html);
  41. $("#divPropSetting").removeClass('hidden');
  42. }
  43. bindPropertySettings(prop) {
  44. var propertySettings = prop.PropertySettings;
  45. if (propertySettings != null && propertySettings != undefined) {
  46. var i = 0;
  47. $(".Controlproperties-Element").each(function () {
  48. if (propertySettings[i].ControlPropertyName == "IsTabView") {
  49. $(this).attr("data-controlpropertyid", propertySettings[i].ControlPropertyId);
  50. $(this).attr("data-controlpropertyname", propertySettings[i].ControlPropertyName);
  51. $(this).attr("data-propertysettingid", propertySettings[i].PropertySettingId);
  52. if (propertySettings[i].ControlPropertyValue == "true") {
  53. $("#IsTabView").prop("checked", true);
  54. }
  55. else {
  56. $("#IsTabView").prop("checked", false);
  57. }
  58. }
  59. i += 1;
  60. });
  61. }
  62. }
  63. savePropertySettings(prop) {
  64. var propertySettings = prop.PropertySettings;
  65. var propSettingReq = [];
  66. $(".Controlproperties-Element").each(function () {
  67. var data = {
  68. FormPropertyId: Number(prop.FormPropertyId),
  69. ControlPropertyId: Number($(this).attr("data-controlpropertyid")),
  70. ControlPropertyValue: $(this).children().find("input").prop("checked").toString(),
  71. ControlPropertyName: $(this).attr("data-controlpropertyname"),
  72. ControlId: Number(prop.ControlId),
  73. PropertySettingId: Number($(this).attr("data-propertysettingid")),
  74. };
  75. propSettingReq.push(data);
  76. });
  77. return propSettingReq;
  78. }
  79. static Instance() {
  80. if (this._instance === undefined)
  81. this._instance = new RadioBox_Settings();
  82. return this._instance;
  83. }
  84. }
  85. Controls.RadioBox_Settings = RadioBox_Settings;
  86. })(Controls = Forms.Controls || (Forms.Controls = {}));
  87. })(Forms = Unibase.Forms || (Unibase.Forms = {}));
  88. })(Unibase || (Unibase = {}));