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'?

Parents
  • 720
    Offline posted

    Hello Steven,

    Thank you for contacting Infragistics Community!

    I believe you will find the following sample very helpful in order to achieve the required. As you can observe I’m calling the igxGrid change detection right after updating the “Ordered” value (if the “Ordered” value > “Units in Stock” value). For example, on the first row, try to set “Ordered” to 40 and without submitting just click on “Units In Stock” and you will see that its value has been already updated. When omitting the detectChanges() the issue you are facing will be reproduced.

    If this sample is not an accurate demonstration of what you are trying to achieve please feel free to modify it and send it back to me for further investigation.

    Looking forward to hearing from you.

    Best Regards,
    Martin Evtimov
    Entry Level Software Developer
    Infragistics, Inc.

Reply Children