Work on asynchronous select widget loading.

Not working yet, but significant progress.
This commit is contained in:
Simon Brooke 2018-07-04 19:01:18 +01:00
parent a4e0fd1c9a
commit 83f23dd055
6 changed files with 210 additions and 129 deletions

View file

@ -0,0 +1,14 @@
/**
* update the select menu with id `wid` from this `data` whose fields include
* this `entity_key` and these `fields`
*/
function updateMenuOptions(wid, entity_key, fields, data){
$('#' + wid).children().filter(function(){
return $(this).attr('selected') === undefined;
}).remove().end();
$.each(data, function(key, entry){
$('#' + wid).append(
$('<option></option>').attr('value', key).text(entry));
});
}