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

Allow to sort nested columns #593

Closed
marcincichocki opened this issue May 15, 2017 · 3 comments
Closed

Allow to sort nested columns #593

marcincichocki opened this issue May 15, 2017 · 3 comments

Comments

@marcincichocki
Copy link

marcincichocki commented May 15, 2017

Do you want to request a feature or report a bug?

feature

Feature Request

Sorting nested columns is not possible with DataTableService.sortData due to its implementation, specifically this line https://github.com/Teradata/covalent/blob/develop/src/platform/core/data-table/services/data-table.service.ts#L45

http://plnkr.co/edit/3oEaTBkpGjkWrdpEHinJ?p=preview
column BAR.BAZ is not getting sorted

What is the expected behavior?

DataTableService.sortData should work with nested columns

What is the motivation / use case for changing the behavior?

Maping data to flat structure is annoying. Using custom sort method feels like working against the library.

Which version of Angular and Material, and which browser and OS does this issue affect?

@angular/core 4.1.2
@angualr/material 2.0.0-beta.3
@covalent/core 1.0.0-beta.3-2

Did this work in previous versions of Angular / Material?
No

Other information

_getNestedValue of TdDataTableComponent could be moved to the TdDataTableService and used to
get correct value.

I'm willing to send PR for this

@kyleledbetter
Copy link
Contributor

Absolutely a feature request and not a bug since nested columns isn't intended, but we'd like to see your first draft in a PR to consider the feature. Not sure how or when we're approaching the complexity of nested hierarchy since it makes sorting, selection, pagination, filtering, etc, vastly more complex

@marcincichocki marcincichocki changed the title Sorting nested column does not work Allow to sort nested columns May 15, 2017
@maxencefrenette
Copy link

maxencefrenette commented Jun 5, 2017

It looks like nested columns were intended. The _getNestedColumn function was specifically created for that purpose. What would be the problem with using that function for sorting ?

See #189 #207 and 91ab473

@ciarrapeters
Copy link

ciarrapeters commented Oct 10, 2017

Did Teradata Covalent ever provide the ability to sort nested row data? I am using the data-table atomic components, and I have updated to the newest version of Teradata (1.0.0-beta.8-1) and of Angular Material (2.0.0-beta.12). The data I am using to populate my rows comes in an array looking like this:
"data": [
{
"ID": 34,
"Type1": {
"id": 90,
"value": "SomeValue"
},
"System": "System1",
"SystemValue": "SystemValue1",
"Type2": {
"id": 6,
"value": "AnotherValue",
"TypeId": 28
},
"inactive": true,
"createTime": "2010-01-18T13:52:07.12",
"lastModifiedBy": "User",
"rowNotes": "This is a note"
}
]
As you can see there are two nested objects in there (Type1 and Type2), which are two of the columns in the table. I need to be able to sort by their "value" fields. Is there any way I can do this?

Thank you in advance.

@emoralesb05 emoralesb05 added this to the Release Candidate 0 milestone Oct 11, 2017
@emoralesb05 emoralesb05 modified the milestones: Release Candidate 3, Next Release Jan 19, 2018
@emoralesb05 emoralesb05 modified the milestones: Release Candidate 4, Next Release Jan 26, 2018
@emoralesb05 emoralesb05 removed this from the Next Release milestone Feb 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants