mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-02-01 04:42:21 +00:00
Fix regression in autocompleter - when adding new people/orgs/venues through modal they are not autoselected
Ah the lovely fragile javascript ecosystem, I can't even pin down when or why it broke.
This commit is contained in:
@@ -1,16 +1,11 @@
|
|||||||
function changeSelectedValue(obj,pk,text,update_url) { //Pass in JQuery object and new parameters
|
function changeSelectedValue(obj,pk,text,update_url) { //Pass in JQuery object and new parameters
|
||||||
//console.log('Changing selected value');
|
//console.log('Changing selected value');
|
||||||
obj.find('option').remove(); //Remove all the available options
|
obj.find('option').remove(); //Remove all the available options
|
||||||
obj.append( //Add the new option
|
obj[0].add(new Option(text, pk, true, true)); // Add new option
|
||||||
$("<option></option>")
|
//obj.selectpicker('val', pk); //Set the new value to be selected
|
||||||
.attr("value",pk)
|
obj.selectpicker('refresh');
|
||||||
.text(text)
|
|
||||||
.data('update_url',update_url)
|
|
||||||
);
|
|
||||||
obj.selectpicker('render'); //Re-render the UI
|
|
||||||
obj.selectpicker('refresh'); //Re-render the UI
|
|
||||||
obj.selectpicker('val', pk); //Set the new value to be selected
|
|
||||||
obj.change(); //Trigger the change function manually
|
obj.change(); //Trigger the change function manually
|
||||||
|
//console.log(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshUpdateHref(obj) {
|
function refreshUpdateHref(obj) {
|
||||||
|
|||||||
Reference in New Issue
Block a user