Retrieve values from my table?

0

I want to save in a variable the data of my table for example my json brings me 2 fields, name and date.

And I want the first name data to save it in a variable:

example:  var nom = 'the first name record';  var fech = 'the first date record';

and so one by one go running in foreach to send them and make the query

This way I add the data to my table:

$('#ejemplo').bootstrapTable({
  url:'<?= base_url(); ?>index.php/ejemplo/nombres/datos',
  columns: [
    {field: 'nombre',filter:{type:"input"}},
    {field: 'fecha',filter:{type:"input"}}
  ]
}); 

Someone to help me?

    
asked by Soldier 26.07.2017 в 22:34
source

1 answer

0

What do you mean by using a forEach to send them and make the query?

If you want to fill the table with a URL you just have to make sure that your URL returns a list of objects, each object with the same attributes as your names of your fields in your columns, like this:

    [{"nombre": "Nombre 1", "fecha": "25-05-2016"},
     {"nombre": "nombre 2", "fecha": "10-02-2005"}]

Here is an example that is in the same documentation of the bootstrap table: example here !!!

    
answered by 26.07.2017 в 23:07