Addepar / Addepar/ember-table

sorting and queryParams

Open
#761 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.7k
Forks
351
Avg merge
1d 22h
Merged PRs (30d)
1

Description

Hi,

I'm looking for a way to have paging and sorting accessible via query params (for navigation purposes (back button)). For paging I got this working now, but the sorting logic is hardcoded with a click handler which (seems to) means I cannot easily use a link-to helper with its query property in a custom header template.

What would be the recommended manner to achieve sorting via query params?

<t.head
    @columns={{this.columns}}
    @sorts={{this.sorts}}
    @onUpdateSorts={{action "onUpdateSorts"}} as |h|>

    <h.row as |r|>
      <r.cell as |columnValue columnMeta|>
        {{#if columnMeta.isSortable}}
          <EmberTh::SortIndicator @columnMeta={{columnMeta}} />
          <LinkTo @query={{hash sort=columnValue.valuePath}}>{{columnValue.name}}</LinkTo>
        {{/if}}

        <EmberTh::ResizeHandle @columnMeta={{columnMeta}} />
      </r.cell>
    </h.row>
</t.head>

Contributor guide

No contributing guide indexed for this repository

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 reading addon/components/ember-th/component.js around the linked click handler, then review the custom header template and its use of LinkTo query parameters. Clarify the intended sorting and paging behavior before proposing an integration path; done would be a documented, agreed-upon way to preserve sorting through query parameters and navigation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.