Binding Issue

Tags: #<Tag:0x00007f0b0e9951b8>

How to export the data from getsourcedata() in afterchange to the global variable?
A working example in angular will be helpful.

Hey @thakurshivam100

you described the content correctly so I do not know what causing you to stuggle with this example. What is your latest progress?

Hi

saveInstance() {
        this.tabledata = this.getSourceData();
        this.httpService.post('http://localhost:62674/api/storeData', this.tabledata);
    }

on calling this function which is trigerred by afterChange, I am not able to call the post, it shows

Cannot read property 'post' of undefined

On checking ‘this’, it is assigned to handsontable and hence doesnot have Httpservice defined at all.

Hey @thakurshivam100

the only example that I have is this one https://handsontable.com/docs/7.3.0/tutorial-load-and-save.html. Not sure if that’s what would be needed here.
Let me know if we need to big deeper here. Our developers are on a Christmas - New Year vacation so it might take more time now to get their feedback.

2 important things, you already found that “this” is not your component but the handsontable instance. So you could instead declare a const arrow function, that you assign to the afterChange, second after doing this if you have set an id to the table you could get the instance of that table and call handsontable api methods.

Hi
The issue is solved
Thanks

Glad to hear that. Thank you for the update.
I’m closing the topic.