I want to display a dynamic datagrid based on a clob object from a database.
The clob has data that looks like this:
Above is ONE clob object. All are rows that are pipe delimited. The grid needs to be dynamic because the clob object can have 3 columns at times or more or less and can contain 1 to many rows.
The result should yield:
I am not sure how to create a dynamic data grid like this. Any help would be great.
Is there a delimeter between each row? If so, you can call split on the string, then parse each row with split("|").
Create an ArrayCollection. Upon parsing the first row, you'll know the list of property names. Then for each subsequent row, you can create an Object and dynamically assign properties to it. Add each Object to the ArrayCollection using addItem. Set the Datagrid's dataProvider to this ArrayCollection.