I am new to cartodb and i don't understand how to populate a bootstrap table with my json data retreived using sql.execute:
sql.execute("SELECT sonde.the_geom,sonde.nom,sonde_data.time,sonde_data.cod,sonde_data.fluo FROM sonde, sonde_data WHERE sonde.nom = sonde_data.ref_id_nom AND sonde.cartodb_id = '"+selection+"' ORDER by time").done(function(data) {
for (i in data.rows){
nom.push(data.rows[i].nom)
fluo.push(data.rows[i].fluo)
cod.push(data.rows[i].cod)
time.push(data.rows[i].time)
}
console.log(data)
//////////////TABLE//////////////
$(function () {
$('#table-javascript').bootstrapTable({
//method: 'get',
data: data,
cache: false,
height: 400,
striped: true,
pagination: true,
pageSize: 50,
pageList: [10, 25, 50, 100, 200],
search: true,
showColumns: true,
showRefresh: true,
minimumCountColumns: 2,
clickToSelect: true,
columns: [{
field: 'data.nom',
title: 'nom',
align: 'center',
valign: 'bottom',
sortable: true
}, {
field: 'data.fluo',
title: 'fluo',
align: 'center',
valign: 'middle',
sortable: true,
}, {
field: 'data.cod',
title: 'cod',
align: 'center',
valign: 'top',
sortable: true
}]
});
});
})
}
);
enter code
I am unable to display my data into the table, i don't know how to call it... Could someone give me the clue please?