Hi.I am trying to update a select menu, based on another select menu value via ajax call.The code is this.
var value = this.value;
$.ajax({
type: "GET",
beforeSend: function(request) {
request.setRequestHeader("X-Appery-Database-Id", "xxxxxxxxxxxxxxxxxx");
},
url: "https://api.appery.io/rest/1/db/colle...",
data: {
where: '{"FoodId":{"$regex":"^'+value+'"}}'
},
dataType: "json",
success: function(response) {
var items = '';
$.each(response,function(name,value) {
var dropDown = $('FoodSubCategory');//The name of select menu to be updated
items += ""+value.GrName+"";
dropDown.append(items);
dropDown.selectmenu('refresh');
});
},
error: function(xhr, ajaxOptions, thrownError) {
console.log("Load error: " + xhr.status + " " + xhr.responseText);
}
});
I have checked the response and its working ok but the select menu 'FoodSubCategory' is not updated.
Please help.
items += ""+value.GrName+"";