AndrejGajdos/nested-datatables

Getting Error Uncaught TypeError: Cannot read properties of undefined (reading '0') on data update

Opened this issue · 1 comments

Hi,

I am fetching data from api and assigning it to nested data table by using following function.
function createTree(data)
{
var settigns = {
iDisplayLength: 5,
bLengthChange: true,
bFilter: true,
bSort: true,
bInfo: true,
};

  var table = new nestedTables.TableHierarchy(
    "treetable",
    ajaxData,
    settigns
  );
  table.initializeTableHierarchy();

}

So for the first time I am able to see the nested data table and all rows are getting expanded but after 30 Sec I want to update the nested table so I am calling the same function with new data. At that time I am getting below error.

Uncaught TypeError: Cannot read properties of undefined (reading '0')
at DataTable.fnOpen (jquery.dataTables.js:667:1)
at HTMLTableRowElement.eval (NestedTables.js:151:1)
at HTMLDivElement.dispatch (jquery.js:5206:1)
at elemData.handle (jquery.js:5014:1)

Please let me know how can i fix this error.

Hi, did you solve this error?