Skip to content

Want to have column in OnColumnResizeCallback Β #3331

@kokosin4ik

Description

@kokosin4ik

Use case

Hello: steps to reproduce:

  1. Open https://adazzle.github.io/react-data-grid/#/row-grouping. Uncheck Country and Year checkboxes and check Athlete.
  2. In our RawColumnsConfig athlete has index 4. If we froze that column or group by it and resize - inside onColumnResize we are getting idx=1, which is obviously the viewport column index.
  3. In my case I'm saving user table configuration to my backend and if I will use idx=1 to save column width - I will save it to wrong column (country in this case), because in my RawColumnConfig another column at that index

I dont sure that its a bug that we are getting viewport index, so i dont think we need to change idx calculated to pass inside onColumnResize

Proposed solution

I suggest also pass the column object to onColumnResize callback. With that object we can easily define column by 'key'

#3330

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions