[Station profile] Fix when editing a station profile with US County set. If state was set, county could not be changed.
这个提交包含在:
父节点
396b3ae90d
当前提交
616eb0e09b
共有 1 个文件被更改,包括 41 次插入 和 32 次删除
|
|
@ -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 } ?>
|
||||
|
|
|
|||
正在加载…
在新工单中引用