Hi
BLANDIN Ewen,
Greetings from Syncfusion support.
Upon reviewing your inquiry, it appears that you
are encountering difficulties in persisting data from the Grid after
dynamically adding sub columns. We have created a sample based on the files
shared, where the persisted data is properly logged in the actionComplete
event of the Grid. Within the code, we have implemented a conditional statement
inside the map function to ensure that if column.columns is undefined, an empty
array is set to its value. Please refer to the code example and sample provided
below.
|
Index.js
{newColumns != undefined &&
newColumns.map(column => (
<ColumnDirective
field={column.field}
headerText={column.headerText}
columns={column.columns != undefined ? column.columns : []}
/>
))}
|
Sample: https://stackblitz.com/edit/react-ggtb5k-4oi7al?file=index.js
If
you are still facing issues, kindly provide the specific scenario in which the
problem occurs. If possible, attempt to replicate the issue in the provided
sample.
If
you need any further assistance or have additional questions, please feel free
to let us know.
Regards
Aishwarya
R