Using a table to customize another table

I'd like to make a user configurable table component where they can select what columns they see and what order they see them in.

Currently, I'm querying the table and setting the column props then copying that JSON into a column on a reference table. So when the user selects a "report" a script checks to see what their selection is, looks it up on the reference table and for loops through the JSON file to build the column structure so they get the customized table format.

I'd like to automate that so I can pass that customization off to a user to change as they see fit vs. asking the dev team to make a change.

Before I go down this dark path, I thought I'd check to see if someone has done this already or if there's a best practice for it. Because in its current state, it's very clunky and not user friendly in the slightest. I'd rather not be copy/pasting directly into tables.

Thanks!

Go for it!

I've done similar for several projects where various configurations are required. They're even handy when I want to change the configuration.

I've always tried to set mine up with a multi-purpose configuration table. Column structure includes

  • configType
  • description
  • settings
  • editDate
  • userName

or similar. You have the choice of overwriting on edit or adding to the table so you have the possibility of recovery if it gets badly messed up.

In your case you need to figure out the user interface. It could be a table with a column of checkboxes to enable a column view and a dropdown to select the order. This would need an onChange event to reorder the table or something similar.

1 Like

Yeah, I was thinking I could generate check boxes for what columns are visible and add some ordering. I also want to keep some sort of LastModifiedDate and LastConfig in case someone messes it up and needs to roll it back.

I just don't like being trapped into making bespoke table configs every time a quality guy decides they want to look at the data a little differently. :smiley:

Sounds like a Vision table's column attributes dataset. (A "table" to configure tables.) An idea so good that IA traveled back in time to add it to FactoryPMI. You could even preload it with more column definitions than you had in any one table, to cover all of the column names you might have across multiple source tables. (Perspective has nothing like it built-in.)

3 Likes