Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Changing dtOptions or dtColumns after changeData() gives errors and shows old data #359

Closed
RoelRoel opened this issue Jun 30, 2015 · 2 comments
Labels

Comments

@RoelRoel
Copy link

I have a dropdown where you can select an user as a filter for my datatable. When you select "All users" I want to show the column "user" in the datatable but when you selected an specific user that column is not relevant.

I tried updating the options before and after my $scope.dtInstance.changeData() call. But I allways get these errors:

TypeError: Cannot read property 'mData' of undefined
at HTMLTableCellElement. (jquery.dataTables.min.js:88)

TypeError: Cannot read property 'parentNode' of null
at jquery.dataTables.min.js:126

I use the promise way of loading data.

@RoelRoel
Copy link
Author

I now tried it with .notVisible() in stead of not adding the column. This gives no errors but nothing happens and the table gets cleared. I have to call changeData twice now to see it again.

@l-lin
Copy link
Owner

l-lin commented Jul 21, 2015

Mmh it seems the renderer in the changeData function is not the same instance as the one in the render function...

I'll look into it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants