I am new to Tabulator
and I am trying to programmatically empty a Tabulator table
so it can be reused. I found information in the documentation relating to the deleteRow
method and have attempted to use it as follows:
const memberTableId = $(mydiv).attr("id");
const tablesMember = Tabulator.prototype.findTable(memberTableId);
if (tablesMember.length > 0) {
const tableCrewMember = Tabulator.prototype.findTable(memberTableId)[0];
const dataCrewMember = tableCrewMember.getData();
for (i = 0; i < dataCrewMember.length; i++) {
tableCrewMember.deleteRow([i]);
}
}
The findTable
and getData
methods work as advertised and I have no problem iterating through the data array; however, I can't seem to find a way to make the deleteRow
function work for me.
Any assistance is greatly appreciated.
A quick option would be to simply set the data on the table to an empty array:
tableCrewMember.setData([]);
Done!