diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 6733e6b311..f2b6e8a2e8 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2011-09-28 Sergio Martin + + * include/javascript/jquery.pandora.controls.js: Fixed module + select refresh from jquery controls to fix the graph widget + on dashboard + 2011-09-26 Sancho Lerena * index.php: Fixed load of extension startup hook function. diff --git a/pandora_console/include/javascript/jquery.pandora.controls.js b/pandora_console/include/javascript/jquery.pandora.controls.js index 27cf3e17a2..4f5db93095 100644 --- a/pandora_console/include/javascript/jquery.pandora.controls.js +++ b/pandora_console/include/javascript/jquery.pandora.controls.js @@ -91,14 +91,12 @@ this.config = $.extend (this.config, $.pandoraSelectAgentModule.defaults, settings); var config = this.config; - $(this).change (function () { var $select = $(config.moduleSelect).disable (); $(config.loading).show (); $("option[value!=0]", $select).remove (); if (! config.callbackBefore (this)) return; - jQuery.post ('ajax.php', {"page": "operation/agentes/ver_agente", "get_agent_modules_json": 1, @@ -109,9 +107,19 @@ function (data) { jQuery.each (data, function (i, value) { config.callbackPre (); - option = $("") - .attr ("value", value['id_agente_modulo']) - .html (js_html_entity_decode (value['nombre'])); + // Get the selected item from hidden field + selected = $('#hidden-'+config.moduleSelect.attr('id')+'_selected').val(); + if(selected == i) { + option = $("") + .attr ("selected", "selected") + .attr ("value", value['id_agente_modulo']) + .html (js_html_entity_decode (value['nombre'])); + } + else { + option = $("") + .attr ("value", value['id_agente_modulo']) + .html (js_html_entity_decode (value['nombre'])); + } config.callbackPost (i, value, option); $(config.moduleSelect).append (option); }); @@ -122,7 +130,9 @@ "json" ); }); + $(this).trigger("change"); }); + }; } });