I have been trying to create a nested table and have succeeded using the code-1 below. I am trying to create a dynamic IOT table and i am updating the table every time a new data is coming from a device, and I used code-2 below for that. but whenever i try to update, the update is successful but the the nested table is replicating it self so how can I stop this from happening.
================ CODE 1 ==================================
rowFormatter:function(row){
var holderEl = document.createElement("div");
var tableEl = document.createElement("div");
const id = row.getData().id;
holderEl.style.boxSizing = "border-box";
holderEl.style.padding = "10px 10px 10px 10px";
holderEl.style.borderTop = "1px solid #d1ddea";
holderEl.style.borderBotom = "1px solid #d1ddea";
holderEl.style.background = "#fff";
holderEl.setAttribute('class', "subTable" + id + "");
tableEl.style.border = "2px solid #d1ddea";
tableEl.setAttribute('class', "subTable" + id + "");
holderEl.appendChild(tableEl);
row.getElement().appendChild(holderEl);
var myRowData = row.getData().customFields;
var subTable = new Tabulator(tableEl, {
layout:"fitColumns",
data:myRowData,
columns:[
{title:"Name", field:"n",headerSort:true },
{title:"Value", field:"v"},
]
})
},
============= CODE 2 ===========================
tableAllUnits.updateData([{id:unit.id, speedformatted:data.speed}]);