Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
75
Ignite UI for Angular edits that affect multiple cells
posted

I have a grid that has multiple cols, one col is amount - in this case I have an unchangable total amount say 200, my first row is the parent that will hold the 'unallocated' amt. so starting off it has 200, a row is added, put in 10 and the first row needs to change to 190.  I have this working using (onCellEdit)

I have next to it a col of the %'s related to these dollar amounts.  So when I enter the 10 its % needs to change to 5% and the top row when its value changes to 190 it also needs to change the % to 95.  I have this mostly working in (onCellEdit)

The problem is both cols are editable, and if I directly change a $ and click directly into its % the old percentage is showing in the edit.  I need to have it updated prior to going into edit - but how?

Pictures are worth 1000 words.

This is my grid with amounts and %s correct - before a change:

change one amount:

tab directly into the % - the value of 77 should change, but this is what i see when i directly click into it. you can see that my top row dollar amount has been changed, and the % of the first row also is updated.

If I move off this it then gets updated:

I don't know if there is a way to get it to do the calculations AS the user types instead of (onCellEdit) which seems to get hit after you leave the cell?  Or is there a way to get this to complete prior to getting the 'enter edit mode'?