icflorescu / icflorescu/mantine-datatable

Add option to disable column order preserving

Open
#693 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.3k
Forks
102
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem? Please describe.

It looks like in order for column dragging to work, a storeColumnsKey must be supplied to the table. This works fine, however I have a table in which users can dynamically add columns. When these columns are added by the user, I'd prefer for them to be rendered in the order specified in the columns array in the useDataTableColumns hook. Instead, they are always added to the right side of the table. I have a pinned ellipsis menu as the last column, and it would be nice to have it stay there when new columns are added.

Describe the solution you'd like

Perhaps introduce a new prop (preserveColumnOrder?) where users could set to false if they want to opt out of this default behaviour.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the useDataTableColumns hook and references to storeColumnsKey, then trace how dynamically added columns are ordered. Done means an opt-out path keeps newly added columns in the order specified by the columns array while preserving the existing default behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.