I am trying to update a grouplist on success of ajax.
function update_grouplist_items(){
location.reload();
console.log("calling1");
window.setTimeout(function(){
$$("cfg").reconstruct();
}, 3000);
}
//// config tab, to store in db
function add_submit(conf,selected_rows){
console.log(selected_rows.length);
if(conf == "") {alert("Please enter Config Name");}
else if (selected_rows.length == 0) {
alert("Please select atleast two jobs");}
else {
$$("win2").hide();
alert("Successfully Saved");
data = {conf:conf,sel:selected_rows};
$.ajax({ type: "POST",xhrFields:{withCredentials: true},
beforeSend: function(request){request.setRequestHeader("Content-type", 'application/json');},
url:savedataUrl,
data : JSON.stringify(data, null, '\\t'),
processData: false,
success: update_grouplist_items,
});
}
};
“cfg” is my grouplist. However reconstruct works if i have the console window open. Any help would be appreciated