Ag-Grid Custom Cell Editing

Hello,

I have an Ag-Grid where I am facing a difficulty developing the functionality for it. I am a beginner in Dash and JavaScript is not one of my strong skills.

The columns in question are called ‘italy’, ‘iberia’, and ‘southern_europe’.:

The desired functionality is as follows:

all columns are editable. They receive float inputs.

  1. If the user enters a value in italy and/or iberia: southern_europe should be the sum of both
  2. if the user enters a value in southern_europe: italy and iberia should be nulled
  3. if there was already a value in italy and iberia and the user enters a value in southern_europe: this should null italy and iberia and save the newly entered value
  4. if there was already a value in southern_europe and the user enters a value in italy or iberia: this should do what was mentioned in point 1 above.

Your help is highly appreciated as I have been working on this for hours. What could the solution possibly be?!

Thank you

Hello @Jaymie,

You should be able to do this with cellValueChanged with an output being to the rowTransaction that will null the values of Italy and Iberia if the changed column is southern_europe.

Otherwise, for southern_europe, you can use a valueFormatter for this, something like this should work:

{"function": "params.value ? params.value : params.data.italy + params.data.iberia"}

1 Like

Hello @jinnyzor

THANK YOU haha it worked :slight_smile:

2 Likes