Get Datagrid column_id of a component programmatically

I don’t know how to get the column ids of existing columns, but it’s easy to get the column ids of columns created from code. That’s what I did in the DataGridJson component, which includes sortable columns.

Would this approach work for you?