How to call the afterchange from already existing table

Tags: #<Tag:0x00007efc704b91c8>

hi,
i want to create a afterchange method in angular2 for already existing table.i know to create that in angularjs.but i didn’t know to create that in angular2.plz help me.

Hi @user123

Here https://stackblitz.com/edit/angular-5ykm8c-cvnjzi?file=src/app/heroes/heroes.component.ts is a demo for the afterChange hook

http://jsfiddle.net/s6ap7zuo/67/ i have to create like this in angular.help me plz

Hi @user123

here is an updated demo https://stackblitz.com/edit/angular-5ykm8c-xrxeqy?file=src/app/heroes/heroes.component.ts

thank u,but it doesn’t work like this http://jsfiddle.net/s6ap7zuo/67/
my requirement is,if i made any changes in particular cell,it might reflect the another cell.i want to do this.thats y am using afterchange hook.

What is an exact bug scenario where this demo does not do the job, can you share it please?

if i will made some changes in particular cell A,it will do some changes (caluculation) in cell B depends upon the cell A.that is my exact requirement.

This demo uses circular references and you get Maximum call stack size exceeded. If you would like to learn how to create cell dependencies I highly encourage to read this article https://handsontable.com/blog/articles/expand-your-app-with-cell-dependencies.
It also provides lives demos so you can test the implementation.

yah thank u.Alraedy, i implemented these in angular application,it works correctly.but after the first change it get freezed i don’t k now the reason.
http://jsfiddle.net/s6ap7zuo/67/
please u take a look on this.

  1. edit the first cell A1
    2.it automatically changes the cell B1 as C.
    3.after that the table get freezed.

That’s the reason (check it in the console).

In the line 14 you call setDataAtCell method which triggers the afterChange, which again calls (by line 14) the setDataAtCell and so on… browser gets too much requests and sends an error.

The setDataAtCell in the line 18 is blocked by the setter variable that turns on and off for the change event. However, the setDataAtCell from the 14 line doesn’t have any obstacles and it runs each time a cell content change. If you delete this line (14) I think that the code does exactly what you want it to do.

i deleted the 14 line,eventhough am getting the same issue.can i have any other methods to do the same operation.

Here is an updated demo http://jsfiddle.net/vkjrozpb/
What steps do you take to get the same error here? I am not able to reproduce it anymore.

ok fine thank u

So the issue is gone? Great to hear that.

yah thank u.

Thank you for a prompt reply. I am closing the topic.