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

DataTable Column custom sorter support #210

Closed
gatapia opened this issue Apr 15, 2016 · 1 comment
Closed

DataTable Column custom sorter support #210

gatapia opened this issue Apr 15, 2016 · 1 comment
Assignees
Labels
Type: New Feature Issue contains a new feature or new component request
Milestone

Comments

@gatapia
Copy link
Contributor

gatapia commented Apr 15, 2016

It would be good if columns supported functions in the sortable argument. I.e.

<p-column field="x" [sortable]="customsorter">...

Where custom sorter is a standard sorting function , i.e:

customsorter(column: string, row_a: any, row_b: any): number
// i.e. return -1, 0, 1 defending on comparison

Or perhaps as a temporary hack [sortable] could take a string pointing to another column.

This feature ofcourse would allow smart sorting on ordinal fields, such as "Severity" where alphabetical order makes no sense.

@cagataycivici cagataycivici added the Type: New Feature Issue contains a new feature or new component request label Apr 16, 2016
@cagataycivici cagataycivici self-assigned this Apr 16, 2016
@cagataycivici
Copy link
Member

cagataycivici commented Apr 16, 2016

Sounds good. Maybe we can add sortFunction;

<p-column sortable="custom" (sortFunction)="customSort($event)"

Similar to #196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Feature Issue contains a new feature or new component request
Projects
None yet
Development

No branches or pull requests

2 participants