I am trying to modify the existing array renderer so that I can write an additional property to data when an array item is added (I want to automatically add an ID property that is generated based on array index).
I have followed the guidance on modifying existing renders but don’t seem to be having much luck with array renderers.
import { rankWith, scopeEndsWith } from "@jsonforms/core";
import { Unwrapped } from "@jsonforms/material-renderers";
import { withJsonFormsControlProps } from "@jsonforms/react";;
const { MaterialArrayControlRenderer } = Unwrapped;
export const ArrayWithIdControl = (props) => {
return (
<MaterialArrayControlRenderer {...props}/>
)
}
export const arrayWithIdControlTester = rankWith(
3,
scopeEndsWith('testArray')
);
export default withJsonFormsControlProps(ArrayWithIdControl);
At this point I’d just like to see the array layout appear on the UI (and I’ll apply modified logic later) but I just get an error:
Cannot read properties of undefined (reading 'deleteDialogAccept')
Any ideas or helpful docs you can point me at?
Note I have also tried using the MaterialArrayLayout
render but this also gives me an error:
Cannot read properties of undefined (reading 'addTooltip')f
Thanks