Skip to content

Ability to change columns #584

Description

@gmixson

I provide an array of ModelsTableColumnOptions to the component from a getter in my component class. When I change the output of the getter the columns displayed stay the same.

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

  • [Bug] What is the expected behavior?

  • [Feature] What is the motivation / use case for changing the behavior?

I would like to show/hide different columns based on user interaction that is not directly tied to the table. For example, I have a form that I use to determine which types of columns should be displayed.

A side effect would be an easy way to change the order of displayed columns.

  • [Support] What exactly you try to do?

  • Please tell us about your environment:

  • ember-models-table version: 5.2
  • ember version: 5.6
  • ember-data version: 5.3
  • ember-cli version: 5.6
  • node version: 18.15
  • npm or yarn version: 9.5
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

I believe this occurs because the _setupColumns function is only run from the constructor. One possible implementation would be to refactor the 'results' of _setupColumns such as this.processedColumns to be getters that depend on this.args.columns.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions