Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Table] Not possible to sort the custom column #287

Open
5 tasks done
dimabory opened this issue May 22, 2020 · 0 comments
Open
5 tasks done

[Table] Not possible to sort the custom column #287

dimabory opened this issue May 22, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@dimabory
Copy link
Collaborator

Bug Report

Prerequisites

  • Can you reproduce the problem in a MWE?
  • Are you running the latest version?
  • Did you check the FAQs to see if that helps you?
  • Are you reporting to the correct repository?
  • Did you perform a search in the issues?

For more information, see the CONTRIBUTING guide.

Description

Steps to Reproduce

const { Table } = require('precise-ui');
const data = [
  { name: 'A', age: 21 },
  { name: 'B', age: 12 },
  { name: 'C', age: 25 },
];
const cellRenderer = ({ key, data: { name, age } }) => {
  switch (key) {
    case 'name':
      return name;
    case 'age':
      return age;
    case 'name+age':
      return `${name}_${age}`;
    default:
      return '--';
  }
};

<Table
  data={data}
  columns={{
    name: { header: 'Name', sortable: true },
    age: 'Age',
    ['name+age']: { header: 'name_age', sortable: true },
  }}
  cellRenderer={cellRenderer}
/>;
  • Verify the behavior by sorting the last column.

Peek 2020-05-22 10-00

Expected behavior:
The column is sortable.

Actual behavior:
Not possible to sort the column.

Environment details: any

Possible Solution

TBD

@dimabory dimabory added the bug Something isn't working label May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant