Tema: FIFO jquery
Ver Mensaje Individual
  #4 (permalink)  
Antiguo 16/07/2010, 10:37
Avatar de acoevil
acoevil
 
Fecha de Ingreso: julio-2008
Ubicación: localhost/colombia/sevillaValle.php
Mensajes: 1.123
Antigüedad: 15 años, 8 meses
Puntos: 32
Respuesta: FIFO jquery

Q tal, como que lo contrario ??

Bueno este es el codigo, primero se llama esta parte cuando se seleccionan multiples checkbox


Código vb:
Ver original
  1. // Maneja la seleccion de elementos checkbox multiples.[*] Seleccionar todos
  2.     $("#seleccionarDepartamentos").click( function() {
  3.         // Checkbox que selecciona los checkbox hijos...
  4.         check = $(this).attr("checked");
  5.         $('#departamentos-municipios').hide();
  6.        // Se seleccionan iterativamente los elementos hijos con el estado actual del seleccionador... true | false
  7.         $("input[name='"+ $(this).attr("title") +"']").each( function() {
  8.             $(this).attr("checked", check);
  9.  
  10.             agregarMunicipios( this.value );
  11.         } );
  12.  
  13.         for( n = 0; n < cache.lenght; n++ ) {
  14.             alert( cache[ n ] );
  15.         }
  16.     } );



En cada iteracion llama a esta funcion
Código Javascript:
Ver original
  1. agregarMunicipios = function( departamento ) {
  2.         codigoDepartamento = departamento;
  3.         $.post("../ServletSeleccionarMunicipios", {
  4.             "codDepartamento" : codigoDepartamento
  5.         }, function( data ) {
  6.            
  7.             $(data).find('municipios').each( function() {
  8.                 var $municipios = $(this);
  9.                 var $municipio = $municipios.find("municipio");
  10.                 if( $municipio.length ) {
  11.  
  12.                     checkMunicipios = "";
  13.                     codMunicipios = "";
  14.                     nombreMunicipios = "";
  15.  
  16.                     $municipio.find("codMunicipio").each( function( ) {
  17.                         codMunicipios += '-' +  $(this).text();
  18.                     });
  19.                     $municipio.find("nombre").each( function( ) {
  20.                         nombreMunicipios += '-' +  $(this).text();
  21.  
  22.                     });
  23.                     codMunicipios = codMunicipios.split("-");
  24.                     nombreMunicipios = nombreMunicipios.split("-");
  25.  
  26.                     for( n = 1; n < codMunicipios.length; n++ ) {
  27.                         checkMunicipios += '<tr><td></td><td><input type="checkbox" name="municipios[]" value="' + codigoDepartamento + '_' + codMunicipios[ n ] + '" checked/>( '+ codMunicipios[ n ] +' ) '+ nombreMunicipios[ n ] + '</td></tr>';
  28.                     }
  29.  
  30.                     html = $('#departamentos-municipios').html();
  31.  
  32.                     if( ! ($('#' + codigoDepartamento + '_').is("div")) ) {
  33.                         $('#departamentos-municipios').html( html +
  34.                             "<div id='"+ codigoDepartamento +"_' style='display: none; border:0px solid #333'><table><tr><td colspan=\"2\"><input type=\"checkbox\" name=\"seleccionarMunicipios[]\" id=\""+ codigoDepartamento +"_seleccionarMunicipios\" title=\"municipios[]\" onclick=\"seleccionarTodosMunicipios(this.id)\" checked /><strong>Seleccionar Todos</strong></td></tr>"+ checkMunicipios +"</table></div>");
  35.  
  36.                     }
  37.    
  38.                 }
  39.             } );
  40.         });
  41.     }


Al final solo me muestra la ultima peticion y las necesito todas ...
__________________
Como presentar nuestros datos por medio de tablas . clase Aco_DataGrid Version 1.4