Ver Mensaje Individual
  #5 (permalink)  
Antiguo 07/01/2014, 08:23
Avatar de satjaen
satjaen
 
Fecha de Ingreso: septiembre-2012
Ubicación: Jaén (Andalucía)
Mensajes: 893
Antigüedad: 11 años, 7 meses
Puntos: 10
Respuesta: Iluminar filas

Gracias, pero también lo he intentado y no me sale:


Código Javascript:
Ver original
  1. $datos = array();
  2.      
  3.     while($row = mysql_fetch_array($query))
  4.     {
  5.          
  6.           if($row["qnum"]==1)$style="#tabl tr{
  7.                           background:#FFFFFF;
  8.                               }
  9.                             #tabl tr:hover{
  10.                           background:#B9F8F8;
  11.                                                   }";
  12.      
  13.    
  14.    
  15.    
  16.         $datos[] = array(
  17.             'id_aviso'          => $row['id_aviso'],
  18.             'telefonos'          => $row['telefonos'],
  19.             'name'      => utf8_encode($row['name']),
  20.             'apellidos'       => utf8_encode($row['apellidos']),
  21.             'calle'       => utf8_encode($row['calle']),
  22.             'localidad'        => utf8_encode($row['localidad']),
  23.             'aparatos'        => utf8_encode($row['aparatos']),
  24.             'marcas'        => utf8_encode($row['marcas']),
  25.             'style'       =>  $style
  26.            
  27.            
  28.         );
  29.     }


Código Javascript:
Ver original
  1. function filtrar()
  2.  
  3. {
  4.  
  5. $.ajax({
  6. data: $("#frm_filtro").serialize()+ordenar,
  7. type: "POST",
  8. dataType: "json",
  9. url: "ajax.php?action=listar",
  10. beforeSend:function(){
  11. $('.carga1').css('display','block');
  12. $('.carga1').html("<img src='imagenes_menu/ajax-loader4.gif' align='center' /><br />Cargando...");
  13. },
  14. complete: function() {
  15. $(".carga1").show();
  16. $(".carga1").hide();
  17. },
  18. success: function(data){
  19. var html_user ='' ;
  20. if(data.length > 0){
  21. $.each(data, function(i,item){  
  22.  html_user += ' <body>';
  23.  html_user += '<form action="prod_sppb.php" method="post" name="nombreform">';
  24.  html_user += '<table id="tabl">';
  25.  html_user += '<tr bgcolor=#DFEBFF ondblclick="pulsar(this, '+ String.fromCharCode(39) + item.id_aviso +String.fromCharCode(39) + ');" >';
  26.  html_user += '<td style="'+item.style+'"><input name="demo"  type="checkbox" value="' + item.id_aviso + '"/></td>';
  27.  html_user += '<td  style="'+item.style+'">'+item.id_aviso+'</td>';
  28.  html_user += '<td  style="'+item.style+'">'+item.telefonos+'</td>';
  29.  html_user += '<td  style="'+item.style+'">'+item.name+' '+item.apellidos+'</td>';
  30.  html_user += '<td  style="'+item.style+'">'+item.calle+'</td>';
  31.  html_user += '<td  style="'+item.style+'">'+item.localidad+'</td>';
  32.  html_user += '<td  style="'+item.style+'">'+item.aparatos+'</td>';
  33.  html_user += '<td  style="'+item.style+'">'+item.marcas+'</td>';
  34.  html_user += '</tr>';
  35.  html_user += '</table>';
  36.  html_user += '</form>';
  37.  html_user += '</body>';