___ ___ erkimt Failed to load response data ______ qstntxt ___

I am using %code% and I want to update a table after sending certain parameters.

This is the code:

%pre%

When doing this you must return a JSON with my data, but it does not cancel the action and %code% appears. Does anyone know what the error is? I hope you can help me. Thank you very much.

    
______ azszpr88349 ___

To make filters in the table I recommend you use queryParams . This option allows you to send the start date and end date to your php driver called sales_data. to then perform said filter in your sql query, thus returning a bounded json

You can see the documentation Here .

%pre%     
___

0

I am using bootstrapTables and I want to update a table after sending certain parameters.

This is the code:

function actualizarTabla(datoFechaIni, datoFechaFin) {
  $('#venta').bootstrapTable("refresh", {
      url: "<?= base_url(); ?>index.php/modulos/supervisor/supinicio/datos_ventas",
        query: {
          fechaIni: datoFechaIni,
          fechaFin: datoFechaFin
    }
  });
  }

function cargaInicial() {
  $("#e-fechaInicio").change(function() {
    actualizarTabla($("#e-fechaInicio").val(), $("#e-fechaFin").val());
  });
  $("#e-fechaFin").change(function() {
    actualizarTabla($("#e-fechaInicio").val(), $("#e-fechaFin").val());
  });
}

When doing this you must return a JSON with my data, but it does not cancel the action and failed to load response data appears. Does anyone know what the error is? I hope you can help me. Thank you very much.

    
asked by Soldier 20.07.2017 в 17:44
source

1 answer

0

To make filters in the table I recommend you use queryParams . This option allows you to send the start date and end date to your php driver called sales_data. to then perform said filter in your sql query, thus returning a bounded json

You can see the documentation Here .

$('#id_tabla').bootstrapTable({
        method: 'post',
        url: 'consulta_ejemplo.php',
        queryParams: function (p) {
            return {
                filtro_fecha_inicio: $('#datoFechaIni').val(),
                filtro_fecha_fin: $('#datoFechaFin').val()
        },
        formatNoMatches: function () {
            return "No existen datos";
        },
        dataType: 'json',
        cache: false,
        striped: true,
        pagination: true,
        pageSize: 10,
        pageList: [10, 25, 50, 100, 200],
        search: true,
        showColumns: false,
        showRefresh: true,
        clickToSelect: false,
        showPaginationSwitch: true,
        columns: [ {
                field: 'Id',
                title: 'ID',
                align: 'left',
                sortable: true,
                visible: true
            },{
                field: 'Nombre',
                title: 'Titulo',
                align: 'left',
                sortable: true,
        }]

});
    
answered by 20.07.2017 в 18:24