mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Merge pull request #941 from AndreasK79/station_profile_bugfix_edit_county
[Station profile] Fix when editing a station profile with US County s…
This commit is contained in:
@@ -1971,48 +1971,57 @@ function deleteQsl(id) {
|
||||
<?php if ($this->uri->segment(1) == "station") { ?>
|
||||
<script>
|
||||
var baseURL= "<?php echo base_url();?>";
|
||||
|
||||
var state = $("#StateHelp option:selected").text();
|
||||
if (state != "") {
|
||||
$("#stationCntyInput").prop('disabled', false);
|
||||
station_profile_selectize_usa_county();
|
||||
}
|
||||
|
||||
$('#StateHelp').change(function(){
|
||||
var state = $("#StateHelp option:selected").text();
|
||||
if (state != "") {
|
||||
$("#stationCntyInput").prop('disabled', false);
|
||||
|
||||
$('#stationCntyInput').selectize({
|
||||
maxItems: 1,
|
||||
closeAfterSelect: true,
|
||||
loadThrottle: 250,
|
||||
valueField: 'name',
|
||||
labelField: 'name',
|
||||
searchField: 'name',
|
||||
options: [],
|
||||
create: false,
|
||||
load: function(query, callback) {
|
||||
var state = $("#StateHelp option:selected").text();
|
||||
|
||||
if (!query || state == "") return callback();
|
||||
$.ajax({
|
||||
url: baseURL+'index.php/station/get_county',
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
query: query,
|
||||
state: state,
|
||||
},
|
||||
error: function() {
|
||||
callback();
|
||||
},
|
||||
success: function(res) {
|
||||
callback(res);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
station_profile_selectize_usa_county();
|
||||
} else {
|
||||
$("#stationCntyInput").prop('disabled', true);
|
||||
//$('#stationCntyInput')[0].selectize.destroy();
|
||||
$("#stationCntyInput").val("");
|
||||
}
|
||||
});
|
||||
|
||||
function station_profile_selectize_usa_county() {
|
||||
$('#stationCntyInput').selectize({
|
||||
maxItems: 1,
|
||||
closeAfterSelect: true,
|
||||
loadThrottle: 250,
|
||||
valueField: 'name',
|
||||
labelField: 'name',
|
||||
searchField: 'name',
|
||||
options: [],
|
||||
create: false,
|
||||
load: function(query, callback) {
|
||||
var state = $("#StateHelp option:selected").text();
|
||||
|
||||
if (!query || state == "") return callback();
|
||||
$.ajax({
|
||||
url: baseURL+'index.php/station/get_county',
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
query: query,
|
||||
state: state,
|
||||
},
|
||||
error: function() {
|
||||
callback();
|
||||
},
|
||||
success: function(res) {
|
||||
callback(res);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
Reference in New Issue
Block a user