how to load data into my datatable, using ajax, custom filtering.

how to load data into my datatable, using ajax, custom filtering.

cris19ncris19n Posts: 25Questions: 5Answers: 0

Hello guys!

I explain a bit, when I am loading my tablet, the data is loaded directly from the PHP server, the method I use to connect to the database is PDO.

but I have all the data, that is, if there is 1000 data, everything is loaded in the first load, this means that there may be a considerable delay or the server hangs etc.

I have a custom filter so what I want is for the first load to show only the first 20 data (the last recorded).

and that through the custom filter for example:

SELECT * FROM TABLE wher search=searchdt;


$item = "cod_persona_respr";
$valor= $_SESSION["id"];
$usuarios2 = ModelUsers::ctrShowUsers($item, $valor);

$item = null;
$valor= null;
$Showsdts = ModelTable::ctrShowTable($item, $valor);
 foreach ($Showsdts as $key => $value) {

                                echo '<tr id="filaM'.($key+1).'" class="fila-white">

                                    <td style="color: #305d86;">'.$value["fecha_registro_mp"].'</td>



                                                <div class="btn-group" role="group" aria-label="Third group">
                                                    <button class="btn btn-warning btnEditItem manito-clic" edititem="'.$value["cod_table"].'" idUsuario="'.$usuarios2["cod_persona_respr"].'" User="'.$usuarios2["user_pr"].'" data-toggle="modal" data-target="#modalEditarTable"><i class="fa fa-pencil"></i></button>
                                                <div class="btn-group" role="group" aria-label="Third group">
                                                    <button class="btn btn-danger btnDeleteItem manito-clic" deleteitem="'.$value["cod_table_mp"].'" lotep="'.$value["lote_piku"].'" viajep="'.$value["viaje"].'"><i class="fa fa-times"></i></button>


                                    echo '</tr>'

Necesito convertir un arreglo al formato adecuado y pintarlo sobre la mesa.
cada vez que se aplica el filtro.

So here I need to paint this new data, and in case I clean the custom filter, it returns the data that was initially loaded.

I would appreciate the help, the truth is that this is killing my head.

I speak Spanish, I hope I have made myself understood, thank you.


  • rf1234rf1234 Posts: 1,768Questions: 51Answers: 257

    The easiest way to do this is to buy an Editor license. That's how I did it a couple of years ago. I didn't want to worry about doing all the CRUD operations myself. Amortization period was less than one working day.
    A single developer license is just GBP85 which is just 94 Euros or $110.
    Editor is using PDO as well.

Sign In or Register to comment.