I am building table with Tabulator5.2, I need to pass some data to each row as hidden data like DB_ID ..etc example:-
{'extrId' : 10 , 'connectionDbIndex' : 101 }
In order to get the whole data when calling row.getData() or another method.
Let me share how i build the table.
This is the table headers..
var tableHeaders =
[
{formatter:"rowSelection", width:20 , titleFormatter:"rowSelection", hozAlign:"left", headerSort:false, cellClick:function(e, cell){cell.getRow().toggleSelect();}} ,
{title:'id", field:"ID" , hozAlign:"left" ,responsive:2 , headerFilter:'input', headerFilterLiveFilter:true ,headerSort:false }
]
This is table Data:-
var i = 0
counter = 2000
while (i < counter){
var more = {'DB_ID' : 2012 }
var row = {id:1+i, name:"Oli Bob"+i, progress:12, gender:"male"+i, rating:1, col:"red", dob:"19/02/1984", car:1 , site:'new' , ticket:12 , opened:false , cssClass:class2.randomId() , data : {'s' : 10}}
class2.insert_row(row , more)
i++
}
& this is the function which responsible to add the rows.
insert_row(payload , more){
this.tableContent.push(payload)
this.rowMoreData.push(more)
for (let key in payload ){
var headerLabel = key
if (! this.alreadyColumsAdded.includes(headerLabel)){
this.alreadyColumsAdded.push(headerLabel)
var a = {title:headerLabel, field:headerLabel , hozAlign:"left" ,responsive:2 , headerFilter:'input', headerFilterLiveFilter:true ,headerSort:false }
this.tableHeaders.push(a)
}
}
}
Once all rows added to the dict. Finally build the table.
var table = new Tabulator(this.tableId, this.tableOptions);
So kindly how is it possible to add some hidden data to each row ?