table.rows().data() hits the call stack limit

table.rows().data() hits the call stack limit

clbarnesclbarnes Posts: 1Questions: 0Answers: 0

I have a table with about 90,000 rows being processed client-side (I know we should be thinking about server-side for that many, but bear with me). The data source is an array of objects, each with 5 members, one of which ('checked') is a boolean.

If I want to get an array of all the checked=true objects, I have two options:

1) table.rows().every(accumulateFn) - this takes about a minute
2) table.rows().data(), and operate on that array.

However, the latter hits the call stack limit, which it really shouldn't do as, at worst, it's just doing what the first one is, and at best, it's just returning a copy of or reference to an array which datatables has internally anyway. Both work fine on smaller tables.

I am not using datatables' own 'selected' interface, but as I understand it, because I'm using deferred rendering, using that and finding checked elements with $('.selected') would not work.

Replies

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Could you link to a page showing the issue so I can profile it please? There is another on going thread about a performance issue with large tables and selecting all rows which would have an impact with what you describe.

    I don't really understand why the second would trigger the stack error if the first doesn't though. I would have thought that the first would take more operations since it is creating many API instances.

    Allan

This discussion has been closed.