I want to give users the ability to download virtualRowData from their AgGrid and I want them to be able to download only their visible columns and the columns be in the order that they made them. Is there anything built into AgGrid or do I have to do the column part manually?
I can do it manually like this:
virtual_df = pd.DataFrame(virtual_rows)
col_order = []
for col_dict in column_state:
if not col_dict['hide']:
col_order.append(col_dict['colId'])
virt_rows = virtual_df[col_order].to_dict('records')
It took me a while to see that the order of the columns is the order that they are in column_state. I was looking for an order key.