-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async loading of datasource and binding not working with Angular #180
Comments
===== UPDATE ===== I updated my sample at JS Bin: http://jsbin.com/daniyov/edit?html,js,console,output and did some more debugging. It seems that the data source that I assign to my table does not really hold a reference to the object I assigned. The two log outputs show different values:
even though
A similar example that I created, but without Angular / Angular directive, works fine this way: http://jsfiddle.net/mathiasconradt/L4z5pbgb/ Just with Angular / ngHandsontable, I cannot get it to work. |
I found a workaround by updating the settings again like this before re-rendering the table, but I don't understand why this would be needed.
Looks like a bug to me. |
I have a handsontable where I load the data asynchronously, which I simulate with a delay of 3 seconds in my example.
This is the table, configured via
settings="ctrl.settings"
:and the controller like this, where you can see that I set the data source like this data:
_this.delayedData,
:JS Bin: http://jsbin.com/daniyov/edit?html,js,console,output
So the data is being loaded a bit delayed after the table has been defined in the controller. According to the handsontable documentation, the render() method of the table should be called whenever the data changes, like in this example of the documentation.
I do see the "Render!" output in the console, so this code does get called and the data is being loaded into
_this.delayedData
, however, the items don't show up in the table.The text was updated successfully, but these errors were encountered: