Filter, library Table filter Jquery

0

I modify the whole post since I'm going to do it for Jquery as they indicate in a comment.

I am using this plugin:

link

Well in this js it works according to their example:

link

Now I enter my table and it also works:

link

But when taking it to my PHP no -.-

I have this code:

Jquery:

<script>
var tf1 = setFilterGrid("form1");
</script>

The archives:

<link rel="stylesheet" type="text/css" href="../assets/TableFilter/filtergrid.css" media="screen" />
<script type="text/javascript" src="js/tablefilter.js" src="../assets/TableFilter/tablefilter_all_min.js" ></script>

And my table:

<form class="contacto" id="form1" style="margin-bottom:30px;">
        <table id="myTable" class="table table-hover">
            <thead>
                <tr>
                    <th style="text-align:left;">Acronimo Subcategoria</th>
                    <th style="text-align:left;">Descripcion</th>
                    <th style="text-align:left;">Acronimo Categoria</th>
                    <th style="text-align:left;">Registro Calidad</th>
                    <th style="text-align:left;">Edición</th>
                    <th style="text-align:left;">Eliminar</th>

                </tr>
            </thead>
            <?php foreach ($model->Listar() as $r): ?>
                <tr>
                    <td><?php echo $r->__GET('acro_sub'); ?></td>
                    <td><?php echo $r->__GET('descripcion'); ?></td>
                    <td><?php echo $r->__GET('acronimo_cat'); ?></td>
                    <td><?php echo $r->__GET('registro_calidad'); ?></td>

                    <td>
                        <a href="?action=editar&id=<?php echo urlencode($r->acro_sub); ?>"><img src="../../images/icon_editthis.png" width="30px" height="30px"/></a>
                    </td>
                    <td>
                        <a href="?action=eliminar&acro_sub=<?php echo urlencode($r->acro_sub); ?>"><img src="../../images/delete.png" width="30px" height="30px"/></a>
                    </td>
                </tr>
            <?php endforeach; ?>
        </table>
</form>

In the HEAD I have many files put I do not think of problems that not?

What I do not see are the search boxes

    
asked by Alberto Cepero de Andrés 17.05.2017 в 09:26
source

1 answer

0

The table does not have any function that calls it, to be able to declare the script it must be under this one being so that

<table id="myTable" class="table table-hover">
            <thead>
                <tr>
                    <th style="text-align:left;">Acronimo Subcategoria</th>
                    <th style="text-align:left;">Descripcion</th>
                    <th style="text-align:left;">Acronimo Categoria</th>
                    <th style="text-align:left;">Registro Calidad</th>
                    <th style="text-align:left;">Edición</th>
                    <th style="text-align:left;">Eliminar</th>

                </tr>
            </thead>
            <tr>
                    <td>COV</td>
                    <td>Documentos de Gobierno</td>
                    <td>GOV</td>
                    <td>N</td>

                    <td>
                        <a href="?action=editar&id=COV"><img src="../../images/icon_editthis.png" width="30px" height="30px"/></a>
                    </td>
                    <td>
                        <a href="?action=eliminar&acro_sub=COV"><img src="../../images/delete.png" width="30px" height="30px"/></a>
                    </td>
                </tr>
                                <tr>
                    <td>CUS</td>
                    <td>DOCUMENTOS DE RELACIONES EXTERNAS</td>
                    <td>EXT</td>
                    <td>N</td>

                    <td>
                        <a href="?action=editar&id=CUS"><img src="../../images/icon_editthis.png" width="30px" height="30px"/></a>
                    </td>
                    <td>
                        <a href="?action=eliminar&acro_sub=CUS"><img src="../../images/delete.png" width="30px" height="30px"/></a>
                    </td>
                </tr>

        </table>

And just below the script

<script language="javascript" type="text/javascript"> 
    var tf1 = setFilterGrid("myTable"); 
</script>

I'm talking to the web developer and he does not understand it because, that has to be because that's how the library works, I hope you will help

    
answered by 17.05.2017 / 13:03
source