fiduswriter / simple-datatables

DataTables but in TypeScript transpiled to Vanilla JS
Other
1.3k stars 228 forks source link

undefined is not an object (evaluating 't.map') #331

Closed HastaLaVi2 closed 9 months ago

HastaLaVi2 commented 9 months ago

I am using simple-datatables as a product list viewer in my project. But when the tab is left open, I written a code that will update the table every few minutes, so that if new products are in the database, they should be added to the table.

Basically what I do:

const interval = setInterval(getRequests, 60000);

In getRequests function I remove all rows with dataTable.rows.remove, and put new data from database with dataTable.insert.

This works fine. But if the user written anything in the searchbar, and then the update function runs, this error appears:

undefined is not an object (evaluating 't.map')

And, the table loads, but any of the functions does not work. Sorting, searching etc... I do not know what to do.

johanneswilm commented 9 months ago

You need to post an example that is accessible through the web. Else this issue will be closed. Please don't ignore the bug reporting template.

On Thu, Aug 17, 2023, 13:30 HastaLaVi2 @.***> wrote:

I am using simple-datatables as a product list viewer in my project. But when the tab is left open, I written a code that will update the table every few minutes, so that if new products are in the database, they should be added to the table.

Basically what I do:

const interval = setInterval(getRequests, 60000);

In getRequests function I remove all rows with dataTable.rows.remove, and put new data from database with dataTable.insert.

This works fine. But if the user written anything in the searchbar, and then the update function runs, this error appears:

undefined is not an object (evaluating 't.map')

And, the table loads, but any of the functions does not work. Sorting, searching etc... I do not know what to do.

— Reply to this email directly, view it on GitHub https://github.com/fiduswriter/simple-datatables/issues/331, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAERMOGCV5NETE2PIICVF7LXVX6ERANCNFSM6AAAAAA3T5SQ5A . You are receiving this because you are subscribed to this thread.Message ID: @.***>