Skip to content

Reorderable columns, with dynamic columns - example required. #2161

@StephenDye1977

Description

@StephenDye1977

Hi,

This is more my issue than a problem with the control. I'm a complete newby to React and Typescript and have found this control and the examples to be excellent. However, I have been going round in circles with an issue I am really struggling to solve.

Basically Users of my grid can choose their own columns to display using a panel to the right of the grid. This fires off a useMemo hook, to generate the columns and assign them to the columns array for the grid. However once these columns have been added, the users would like to reorder them without having to re-pick them.

I have been following the columnsreordering example, which has static/fixed columns, and can see how the memo works to update the column state.

The problem I have is that when I reorder the columns, the columns do not reorder. This is because I can't put the columns into a state variable, as they are generated in the memo. Is there an example that could be put together to show me how to do this please?

I can share my code offline if required.

Thanks

Steve

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions