From efe8a2eab04d8299a4ca24906cac8fbafd0b435d Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Sat, 17 Feb 2024 15:42:27 +0100 Subject: [PATCH] state list by ajax in station edit --- application/views/station_profile/edit.php | 66 ++++++---------------- assets/js/sections/common.js | 28 +++++++++ assets/js/sections/station_locations.js | 65 ++++++++++++--------- 3 files changed, 84 insertions(+), 75 deletions(-) diff --git a/application/views/station_profile/edit.php b/application/views/station_profile/edit.php index 04f6464cc..8a325c3c4 100644 --- a/application/views/station_profile/edit.php +++ b/application/views/station_profile/edit.php @@ -93,56 +93,24 @@ - -
- - + + + +
- $state_list = $CI->subdivisions->get_state_list($my_station_profile->station_dxcc); - ?> - - result() as $state) { - $selected = ($my_station_profile->state == $state->state) ? 'selected="selected"' : ''; - ?> - - - - - - - -
- - - -
- - -
- - station_cnty; } ?>"> - -
+ +
+ + station_cnty; } ?>"> + +
diff --git a/assets/js/sections/common.js b/assets/js/sections/common.js index 425b755e6..7773e69e9 100644 --- a/assets/js/sections/common.js +++ b/assets/js/sections/common.js @@ -627,6 +627,7 @@ function showQsoActionsMenu(_this) { } }); } + if ($('.table-responsive .dropdown-toggle').length>0) { $('.table-responsive .dropdown-toggle').off('mouseenter').on('mouseenter', function () { showQsoActionsMenu($(this).closest('.dropdown')); @@ -637,6 +638,33 @@ function getDataTablesLanguageUrl() { return "../assets/json/datatables_languages/" + lang_datatables_language + ".json"; } +function statesDropdown(states, set_state = null) { + var dropdown = $('#stateDropdown'); + dropdown.empty(); + dropdown.append($('