question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Correct way to change columns on fly

See original GitHub issue

I need to change columns on fly (received from server), how i can do this in correct way? I trying dtInstance.rerender() method:

$scope.dtInstance.rerender();

but this cause an error:

TypeError: Cannot read property 'style' of undefined
    at _fnCalculateColumnWidths (jquery.dataTables.js:4134)
    at _fnInitialise (jquery.dataTables.js:3261)
    at HTMLTableElement.<anonymous> (jquery.dataTables.js:6510)
    at Function.n.extend.each (jquery-2.1.3.min.js:2)
    at n.fn.n.each (jquery-2.1.3.min.js:2)
    at DataTable (jquery.dataTables.js:6041)
    at $.fn.DataTable (jquery.dataTables.js:14664)
    at Object.g [as renderDataTable] (angular-datatables.min.js:6)
    at angular-datatables.min.js:6
    at angular.js:14417

Example here: http://plnkr.co/edit/nix7va?p=preview Simplified example, in reality, the columns will be completely different. Modify visibility of column not is solution.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
janetwucommented, Sep 15, 2017

solves my problem,thx

1reaction
f0defcommented, Jul 15, 2015

@jmelosegui of course, the example updated see here

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add columns to a Power Apps grid on the fly | 365.Training
In this video David Yack shows us how to quickly add a column to a Power Apps grid on the fly.
Read more >
Substituting Column Values From Other Columns On The Fly - Stack ...
What's the best way to select the minimum value from several columns? ... Exclude a column using SELECT * [except columnA] FROM tableA?...
Read more >
How to change column names on the fly in mysql? - SitePoint
Tapan: How do I change column names in the SELECT sql statement so that when data is returned it returns the col names...
Read more >
Service Portal : change column size on the fly - ServiceNow
Hi, I have a page in which I have 5 containers. In the container 4, there are 4 instances of information displayed as...
Read more >
Adjusting number of columns on the fly - Org Chart - Plumsail ...
This seems like a useful function to change the number of display columns in compact mode, but I infer by it's behavior that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found