问题描述
我对此很陌生,所以请客气哈哈。 我设法用Tabulator生成了5个表,并从Public Transit API生成了一些总线数据,现在我希望当单击一行时能够保护数据库中的数据安全。 我添加了rowClick事件,但是单击它时没有任何反应。 谁能帮我吗?
busstop.bindPopup(name);
var table = new Tabulator("#table"+(i+1),{
height: 205,layout: "fitColumns",//fit columns to width of table (optional)
columns: [
{ title: "Busnumber",field: "busnumber" },{ title: "Direction",field: "direction" },{ title: "Departure time",field: "departuretime" }
],rowClick: function (e,row) {
console.log(row.getData());
},});
var tabledata = [];
for (let i = 0; i < object.length; i++) {
var departure = {
busnumber: object[i].transport.name,direction: object[i].transport.headsign,departuretime: object[i].time.split('T')[1].split('+')[0]
}
var date = object[i].time.split('T')[0]
tabledata.push(departure);
}
table.setData(tabledata);
var Now = document.getElementById('table'+(i+1));
var innerHtml = Now.innerHTML;
Now.innerHTML = '<h5>'+name+'</h5>'+innerHtml;
}
´´´
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)