Add an option to not update cell innerHtml on row invalidation

Add an option to not update cell innerHtml on row invalidation

RagingTrollRagingTroll Posts: 34Questions: 3Answers: 0

When we integrate DataTables with a binding framework like Angular or Knockout the cell html will be updated automatically when the data changes.

When we only bind a value to the cell, innerHtml will not break the binding so everything is ok so far.
The problem arises when we bind a template to a cell where we have nested html elements and each element has its own binding. Setting innerHtml in this case breaks all bindings as the dom elements are recreated.

Problematic line: https://github.com/DataTables/DataTables/blob/master/media/js/jquery.dataTables.js#L1437

Answers

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

    Interesting - thanks for the suggestion. I'm not immediately sure what the best way of dealing with this is, but it is something that I'd like to look at, having DataTables working better with Angular etc. Thanks for the suggestion!

    Allan

  • RagingTrollRagingTroll Posts: 34Questions: 3Answers: 0

    Thanks for taking the time to look through all our suggestions :)... we're currently working on integrating DataTables with Angular... it's still in the developing phase, but it's mostly working... you can check it out at

    https://github.com/maca88/datatables.plugins

    so you don't have to start from zero when you decide to go this route

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

    Super - thanks for the link!

    Allan

This discussion has been closed.