Relation between loadData and binding

Tags: #<Tag:0x00007efc6d307af8>

What is the relation between data binding and loadData method?

I’m using Angular and data binding. And it works 1st time.
Problem is: as I change bound array (usually completely re-populate it) the HOT instance does not see any changes (old data are displayed). I have no idea whether it’s Angular problem or HOT problem.

However, if I call loadData() with bound array as argument, it works just as expected – HOT shows new data.

Question is: how loadData() affects existing data binding?

Thank you!

Hey @igort

data binding is done via data option in the Handsontable settings. Additionally you can pass new data via setDataAtCell (single cell) or via loadData (whole array ob arrays/objects). This demo should explain how it works https://jsfiddle.net/mzrLus27/ but if I’m missing something feel free to ask.

OK, that’s clear.
But the question is: I use data option to bind data array initially. Then I use loadData (or setDataAtCell) to modify data. Are those changes reflected to initially bound data structure?

Thank you.

No, every operation on new data stays for new data. Here’s an example to show that https://jsfiddle.net/AMBudnik/jnp7oku2/
As you can see the oldData is still null