Inidivual search engine for each table

0

I have two tables created, each one with its respective search engine only when I search in one they look for me in the two thanks for their help

<div id="infouser">

                  <img src="<?php echo base_url();?>css/images/001-hombre.png"  id="imgmi1"/> 

                   <input type="text" id="search" name="txtautor1" placeholder="Primer Integrante del ante proyecto" value="<?php foreach ($documentos as $documents){
    echo $documents->autor1;} ?>" />
                   <table id="tbl_integrantes"  width="100%" cellspacing="0">
        <thead>
            <tr>
                <th></th>
                <th></th>
                <th></th>
                <th></th>
                <th></th>
                <th></th>
            </tr>
        </thead>
        <tbody>
        <?php
            foreach ($integrantes as $integrants){

                echo '<tr>';
                echo '<td  class="boton"><img src="'.base_url().'css/images_perfil/'.$integrants->imgperfil.'" alt="imagen_perfil" class="imgperfiltabla" /></td>';
                echo "<td class='numero boton'>$integrants->codigo</td>";
                echo "<td class='nombre boton'>$integrants->nombre1  $integrants->nombre2</td>"; 
                echo "<td class='apelli boton'>$integrants->apellidos</td>";
                echo "<td class='boton'>$integrants->email</td>";
                echo "<td class='boton'>$integrants->tel</td>";
                echo "</tr>";
            }
            ?>

        </tbody>
    </table>


               </div>

                 <br><br>
                  <label for="txtautor2" style="margin-left:20px; font-size:1.5em; text-decoration:underline;">Segundo Autor</label>
                 <br>

               <div id="infouser2">

                  <img src="<?php echo base_url();?>css/images/002-empleados.png"  id="imgmi2"/> 

                   <input type="text" id="search2" name="txtautor2" placeholder="Segundo Integrante del ante proyecto" value="<?php foreach ($documentos as $documents){
    echo $documents->autor2;} ?>" />
                   <table id="tbl_integrantes2"  width="100%" cellspacing="0">
        <thead>
            <tr>
                <th></th>
                <th></th>
                <th></th>
                <th></th>
                <th></th>
                <th></th>
            </tr>
        </thead>
        <tbody>
        <?php
            foreach ($integrantes as $integrants){

                echo '<tr>';
                echo '<td  class="boton2"><img src="'.base_url().'css/images_perfil/'.$integrants->imgperfil.'" alt="imagen_perfil" class="imgperfiltabla" /></td>';
                echo "<td class='numero2 boton2'>$integrants->codigo</td>";
                echo "<td class='nombre2 boton2'>$integrants->nombre1  $integrants->nombre2</td>"; 
                echo "<td class='apelli2 boton2'>$integrants->apellidos</td>";
                echo "<td class='boton2'>$integrants->email</td>";
                echo "<td class='boton2'>$integrants->tel</td>";
                echo "</tr>";
            }
            ?>

        </tbody>
    </table>
               </div>

    $(function () {
  $('#search').quicksearch('table tbody tr');                               
});
});

  $(function () {
  $('#search2').quicksearch('table tbody tr');                              
});
});
    
asked by mateo nieto 21.11.2017 в 16:38
source

1 answer

1

That's because both quicksearch are passing the same value for which they would only recognize a single table, you should do so:

$(function () {
  $('#search').quicksearch('#tbl_integrantes tbody tr');                               
});

$(function () {
  $('#search2').quicksearch('#tbl_integrantes2 tbody tr');                              
});
    
answered by 21.11.2017 / 16:43
source