I have an admin form created via an XML component which inserts a listing via the insertListing component. This listing takes data from a custom table I created for this module. The listing works: I can see the records from my custom table.
My custom table has a column that stores an array of data in a JSON format. Currently, my inserted listing shows the column with the JSON data. What I'd like to achieve is having a separate column for all the values in the JSON. The difficulty is that these JSON data can have different keys, so I cannot have the column declared statically in the XML and filled the column in with the values via dataProvider as I would normally do with UI components.
Example:
- record A has a json of {X:1, Y:2}
- record B has a json of {Y:1, Z:3}
What I currently see in the grid:
- first row with column "jsondata" e value {X:1, Y:2}
- second row with column "jsondata" e value {Y:1, Z:3}
What I'd like to achieve:
- first row with 3 columns: column X with value 1, column Y with value 2 and column Z with value 0
- second row with 3 columns: column X with value 0, column Y with value 1 and column Z with value 3
So what I'd need is a way to dynamically add columns to the XML. Is there a way to do it?
