[DataGrid Reactive Dynamic Columns] Dynamic Column Types
Reactive icon
Forge component by Henrique Silva
Application Type

We're curious if we can use this plugin with DataGrids to not only have dynamic columns, but also dynamic column types. We currently use a similar functionality where you feed the datagrid a JSON string with our data, inclusive of column names, but all of the values are string. It looks like you can provide the JSON string with Metadata regarding the column type, which would allow use to use numbers, dropdowns, strings, long text, etc . that DataGrid can handle. I'm wondering if that is possible using the CellValueFinalDataType = The data type of your the data from the dynamic columns in your data grid. 

The end goal is to be able to add columns of different types in the DataGrid UI, similar to the functionality below:

And once you click new column, a popup appears: 

We can do both of those steps, but haven't found a way to provide DataGrid with dynamic column data types. 

Hello Alex!

The currently published version (1.1.3) does not allow this functionality.

I get your request and this will be fully implemented on the next version of this asset.

For now, I have created a new javascript action that receives a list of dynamic columns and their datatypes to add to the metadata of the JSON. I have "quickly" tested it and it works.

If you are using binding columns on the grid itself, you will also have to define your dynamic datatype column logic on the list of dynamic columns you have.

I have attached the OML file of this asset with the new action. You can also see a quick demo of how it looks like on this page. (The logic was column names with even name length are boolean and the others are decimal, this was just for testing)


Hope it helps!



We'll check out the OML file and the demo. Thank you for the update! We'll also be on the lookout for the new version of the asset with this functionality. It will be extremely powerful to use. 

Hello Alex!

I have just published a new version(1.1.5) of the asset including the new action for each dynamic column to have its own datatype.

If you have any additional feedback, please let me know.


Hi Henrique, awesome work.  I am trying to load the datagrid using checkbox column following the DemoEditable.  I am unable to get checkbox in unchecked state.  I tried to pass in boolean but still unable to get checkbox unchecked.  Please inform how to use boolean datatype dynamic column where some are checked and some are not at initial load.

Hello Zogi!

Sorry for the late reply. At the time I did noticed the code actually had an issue with getting unchecked values on the DataGrid, but I did not have the availability to fix it.

I have just released a new version 1.1.6 with a fix for this issue. It is fixed on bothe de client and server side actions. The fix can also be seen on the demo asset and on the "try now" link!

Hi @Henrique Silva,

Thank you for the information on that forge component, I have a question regarding your remark 

"If you are using binding columns on the grid itself, you will also have to define your dynamic datatype column logic on the list of dynamic columns you have. "

I'm interested in HTML content type. I have found a way to enable HTML content for a column after the grid has been built. I just loop each column and find the one I need and then make the property isContentHtml = true. I was wondering if it's possible to define HTML data type before the grid is built.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.