Skip to content

Conversation

s-rubenstein
Copy link
Contributor

@s-rubenstein s-rubenstein commented Aug 18, 2017

<clr-dg-column [clrDgField]="'cohort.name'" [clrDgSortBy]="cohortNameComparator">
Name
<clr-dg-string-filter [clrDgStringFilter]="cohortNameFilter"></clr-dg-string-filter>
<clr-dg-string-filter [clrDgStringFilter]="cohortNameFilter" ></clr-dg-string-filter>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: extra space

@s-rubenstein s-rubenstein merged commit 875d5f6 into master Aug 21, 2017
@s-rubenstein s-rubenstein deleted the blrubenstein/table-sorting branch August 21, 2017 17:25
* determine the order that the cohorts loaded into client side memory
* are displayed.
*/
class CohortNameComparator implements Comparator<Cohort> {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would you think of just having a common localeStringComparator used by most of our tables?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related: There is some duplication here. Could we have something like HasName and HasDescription interfaces and then get something like:

class DescriptionComparator implements Comparator<HasDescription> {
  compare(a: HasDescription, b: HasDescription) {
    return a.description.localeCompare(b.description);
  }
}

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants