Work on asynchronous select widget loading.
Not working yet, but significant progress.
This commit is contained in:
parent
a4e0fd1c9a
commit
83f23dd055
6 changed files with 210 additions and 129 deletions
14
resources/js/select-widget-support.js
Normal file
14
resources/js/select-widget-support.js
Normal 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));
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue