Built files from Bizgaze WebServer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cityauto.js 4.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. var Bizgaze;
  2. (function (Bizgaze) {
  3. let Apps;
  4. (function (Apps) {
  5. let Crm;
  6. (function (Crm) {
  7. let Components;
  8. (function (Components) {
  9. class CityAuto {
  10. init(formpropertyid, prop, callback) {
  11. var instance = this;
  12. var url = _appsettings.server_url() + '/apis/v4/bizgaze/crm/cities/citiesautotext';
  13. AutoCompleteHelper.getHelper().Create("#autocomplete_cities", "#hfAutoComplete_CityId", url, function (response) {
  14. var data = response;
  15. if (data.id != 0 && data.selected != true) {
  16. $("#autocomplete_districts").empty();
  17. var addData = data.addlData;
  18. var sp = addData.split('|');
  19. var citycode = sp[0];
  20. var districtname = sp[1];
  21. var districtid = sp[2];
  22. $(".txt_citycode").val(citycode);
  23. $(".txt_citycode").attr("disabled", "disabled");
  24. $(".div_citycode ").addClass("floating-label-form-group-with-value");
  25. var option = new Option(districtname, districtid, true);
  26. $("#autocomplete_districts").append(option);
  27. $("#autocomplete_districts").attr("disabled", "disabled");
  28. }
  29. });
  30. if (callback != null)
  31. callback();
  32. }
  33. loadControl(containerid, prop) {
  34. var html = '<div id="div_cityautotext">' +
  35. '<label for= "lblCity" class= "font-bold">Cities</label><span class="text-danger" id="spnIsRequired_cityautotext"> *</span>' +
  36. '<select id ="autocomplete_cities" class="form-control text-control" style ="width:100%" placeholder=" Select City" data-placeholder="Select City"></select>' +
  37. '<input type ="hidden" id ="hfAutoComplete_CityId" class="hfAutoComplete_CityId form-control value-control" data-isdynamic="true"></div>';
  38. $("#" + containerid).html(html);
  39. }
  40. loadControlSettings(controlsettingjson, formpropertyid) {
  41. return [];
  42. }
  43. loadPropertySettings(propertysettings, formpropertyid, DocPropertyName) {
  44. return [];
  45. }
  46. bindEditFormDetails(formpropertyid, propval, DocPropertyName) {
  47. if (propval != "null") {
  48. var instance = this;
  49. var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
  50. var IdValue = propval;
  51. var TextValue = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_cityname").Value;
  52. var selectedOptions = new Option(TextValue, IdValue, true);
  53. if (IdValue != "0") {
  54. $("#autocomplete_cities").append(selectedOptions);
  55. jQuery("#autocomplete_cities").val(IdValue).trigger("change");
  56. }
  57. }
  58. }
  59. static Instance() {
  60. if (this.instance === undefined) {
  61. this.instance = new CityAuto();
  62. }
  63. return this.instance;
  64. }
  65. }
  66. Components.CityAuto = CityAuto;
  67. })(Components = Crm.Components || (Crm.Components = {}));
  68. })(Crm = Apps.Crm || (Apps.Crm = {}));
  69. })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
  70. })(Bizgaze || (Bizgaze = {}));