Foros del Web » Programando para Internet » Javascript » Frameworks JS »

tablesorter me inutiliza el resto de scripts

Estas en el tema de tablesorter me inutiliza el resto de scripts en el foro de Frameworks JS en Foros del Web. Hola a todos, después de que me ayudárais con mis dudas anteriormente recurro a vosotros otra vez, tengo un problema con un script, concretamente uno ...
  #1 (permalink)  
Antiguo 31/10/2012, 05:11
Avatar de tito87  
Fecha de Ingreso: septiembre-2012
Ubicación: Tarragona
Mensajes: 25
Antigüedad: 11 años, 6 meses
Puntos: 0
tablesorter me inutiliza el resto de scripts

Hola a todos,

después de que me ayudárais con mis dudas anteriormente recurro a vosotros otra vez,

tengo un problema con un script, concretamente uno que uso para ordenar las tablas, el script es propiedad de :
Código:
/*
 * 
 * TableSorter 2.0 - Client-side table sorting with ease!
 * Version 2.0.5b
 * @requires jQuery v1.2.3
 * 
 * Copyright (c) 2007 Christian Bach
 * Examples and docs at: http://tablesorter.com
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * 
 */
La estructura es la siguiente:

Una tabla con archivos, y debajo un botón para añadir archivos nuevos, ese botón al ser pulsado hace un slideToggle para dejar ver un selector de archivos.
El problema es que en el momento que pincho en alguna de las cabeceras de la tabla para ordenar el contenido de la tabla el botón dejar de funcionar y ya no muestra el selector de archivos, es más, si el selector de archivos está visible y después pulso la cabecera de la tabla éste desaparece y el botón se inutiliza.
Os pego el código:

Código HTML:
Ver original
  1. <table id="table-project-files">
  2.         <thead>
  3.             <tr>
  4.                 <th style="width:2%; border-right:none"><input type="checkbox" class="master-checkbox checkbox" /></th>
  5.                 <th style="width:54%; border-left:none">File name</th>
  6.                 <th style="width:15%">Upload date</th>
  7.                 <th style="width:10%">Size</th>
  8.                 <th style="width:2%; text-align:center; "></th>
  9.                 <th style="width:2%; text-align:center">+</th>
  10.             </tr>
  11.         </thead>
  12.         <tbody>
  13.             <?php if($files->num_rows() == 0): ?>
  14.             <tr class="no-files odd">
  15.                     <td colspan="7">This category has no files.</td>
  16.             </tr>
  17.             <?php else: ?>
  18.                 <?$i=0;?>
  19.                 <?php foreach($files->result() as $file):
  20.                     $files2=$this->files_model->get_file_by_id($file->idfile);
  21.                         foreach($files2->result() as $file2):?>
  22.                             <tr>
  23.                                 <td><input type="checkbox" name="checkbox[<?=$i?>]"class="checkbox_children" value="<?=$file2->idfile?>" /></td>
  24.                                 <td><?=anchor_popup($file2->path.'/'.$file2->name, $file2->name)?></td>
  25.                                 <td><?=$file2->date?></td>
  26.                                 <td><?=byte_format(filesize(DATAPATH.'/'.$file2->path.'/'.$file2->name));?></td>
  27.                                 <td><a class="little-button gray" onclick="var info = getDlFile(<?=$file2->idfile?>);fileExtraInfo(info, true, this)">+</a></td>
  28.                                 <td></td>
  29.                             </tr>
  30.                             <?$i++;?>
  31.                          <? endforeach;?>
  32.             <?php endforeach; ?>
  33.         <?php endif; ?>    
  34.         </tbody>
  35.     </table>
  36.  
  37. <div class="panel gray new-file" style="display:none">
  38.     <?=form_open_multipart('projects/project/upload_file')?>
  39.                 <input type="file" name="userfile" style="width: 50%" required/><br>
  40.                 <div class="button-bar right">
  41.                     <button type="button" class="short red" onclick="$('.new-file').slideUp('slow', function() { $('.file-fields').remove() });">
  42.                         <img src="<?=base_url()?>image/icon-delete.png" /> Cancel
  43.                     </button>
  44.                     <button type="submit" class="short green">
  45.                         <img src="<?=base_url()?>image/icon-upload.png" /> Upload
  46.                     </button>
  47.                 </div>
  48.     </form>
  49. </div>
  50.  
  51. <button type="button" id="botonañadir" class="large green" onclick="if($('.new-file').find('.file-fields').length == 0) $('.new-file').slideDown('slow')">
  52.     <img src="<?=base_url()?>image/icon-new.png" /> Add new files

Código Javascript:
Ver original
  1. <script language="javascript" type="text/javascript">
  2.     $(document).ready(function() {
  3.         $('#table-project-files').tablesorter({headers : {  0 : {sorter : false},
  4.                                                                 1 : {sorter : 'name'},
  5.                                                                 4 : {sorter : false},
  6.                                                                 5 : {sorter : false}
  7.                                                             },
  8.                                                 widgets : ['zebra']
  9.         });
  10.     });
  11.    
  12. </script>

El código del tablesorter es público y el script está aquí:
[URL="http://tablesorter.com/docs/"]http://tablesorter.com/docs/[/URL]

Muchas gracias, espero que me podáis ayudar.

Etiquetas: funcion, html, input, php, resto, scripts, botones
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:22.