X-Git-Url: https://git.llucax.com/software/sercom.git/blobdiff_plain/fcd65e663e7984ae5bd81e0a4d7cff4d6d0c85c5..50ac259f4dbe8e25e0a790a9ae2528dffa970195:/sercom/widgets.py?ds=inline diff --git a/sercom/widgets.py b/sercom/widgets.py index 5a06ea7..5f9540c 100644 --- a/sercom/widgets.py +++ b/sercom/widgets.py @@ -19,7 +19,7 @@ class CustomTextField(widgets.TextField): ''' -AlumnoMultiSelectAjax = ''' +MultiSelectAjax = ''' function _on_alumno_get_result(lista, loading, results) { @@ -43,8 +43,24 @@ AlumnoMultiSelectAjax = ''' load.style.visibility = 'hidden'; } - function agregar_a_la_lista(texto, lista, loading) + function sacar_de_la_lista(lista) + { + l = MochiKit.DOM.getElement(lista); + if (l.selectedIndex < 0) return; + + /* caso especial, 1 solo item */ + if (l.options.length == 1) { + l.options.length = 0 + return; + } + + for (i=l.selectedIndex; i
+ onClick=" _do_add(${on_add}, '${field_id}_nuevo', '${field_id}', '${name}_loading'); " />