X-Git-Url: https://git.llucax.com/z.facultad/75.52/sercom.git/blobdiff_plain/accfacb2c3157f66330d4bd5d0bd15f56bfe7168..706ad3223b5e5f4de2cbdefec72f0f2f78ba79f4:/sercom/widgets.py?ds=sidebyside diff --git a/sercom/widgets.py b/sercom/widgets.py index b4b7e13..6379964 100644 --- a/sercom/widgets.py +++ b/sercom/widgets.py @@ -21,8 +21,9 @@ class CustomTextField(widgets.TextField): AlumnoMultiSelectAjax = ''' - function _on_alumno_get_result(lista, results) + function _on_alumno_get_result(lista, loading, results) { + load = MochiKit.DOM.getElement(loading); load.style.visibility = 'hidden'; if (results.error) { alert(results.msg); @@ -31,13 +32,14 @@ AlumnoMultiSelectAjax = ''' MochiKit.DOM.appendChildNodes(lista, OPTION({'value':results.msg.id}, results.msg.value)); } - function _on_alumno_get_error(results) + function _on_alumno_get_error(loading, results) { alert(results) + load = MochiKit.DOM.getElement(loading); load.style.visibility = 'hidden'; } - function agregar_a_la_lista(texto, lista) + function agregar_a_la_lista(texto, lista, loading) { t = MochiKit.DOM.getElement(texto); @@ -54,11 +56,11 @@ AlumnoMultiSelectAjax = ''' alert('Debes seleccionar un curso primero'); return; } - load = MochiKit.DOM.getElement('loading'); + load = MochiKit.DOM.getElement(loading); load.style.visibility = 'visible'; url = "/grupo/get_inscripto?cursoid="+curso.options[curso.selectedIndex].value+"&padron="+t.value; var d = loadJSONDoc(url); - d.addCallbacks(partial(_on_alumno_get_result, lista), _on_alumno_get_error); + d.addCallbacks(partial(_on_alumno_get_result, lista, loading), partial(_on_alumno_get_error, loading)); t.value = ""; } @@ -83,9 +85,9 @@ class AlumnoMultiSelect(widgets.MultipleSelectField):
- + + onClick=" agregar_a_la_lista('${field_id}_nuevo', '${field_id}', '${name}_loading'); " /> |