AngularJS ngHandsontable value change event

Tags: #<Tag:0x00007efc6df134f0> #<Tag:0x00007efc6df12320>

Hi, Is there any event in hot-table (for Anglar 1 or Angular JS) which occurs when any cell value is changed either by typing or pasting the value. I tried “afterChange” but it seems to be for other purpose.

Please see below for example in which change event can occurs if price value is changed.
https://jsfiddle.net/aszymanski/09a7zcL6/

Thanks

Hi @zeeshanef

Thank you for contacting us. The afterChange hook is made for this purpose. I modified your example: https://jsfiddle.net/handsoncode/j4sku3w1/ It will register and log any change within the table. You can see the following informations logged: row, prop, oldVal, newVal

1 Like

Thanks @adrian.szymanski

Looks like afterChange hook is for the said pupose.

but it is not working when I define custom event name as following:

<hot-table hot-id="hottableExample"
   settings="{                         
			   contextMenu: false, 
			   afterChange: AfterChangeGrid1
			  }"
</hot-table>

//controller part:
$scope.AfterChangeGrid1= function (changes, source)
{
}

But when I keep the event name same as the property name so its working i.e. “afterChange: afterChange”

Hi @zeeshanef

When I tried to define it separately it also works correctly: https://jsfiddle.net/handsoncode/z5ogx0km/ Please modify this example to match your settings if needed.

1 Like

Thanks @adrian.szymanski issue resolved.

Hi @zeeshanef

Thank you for the update. I’m glad that it’s solved. I will close this topic now.