Skip to content

Sorting with null values and custom sortFn does not behave as expected #939

@dustinsgoodman

Description

@dustinsgoodman

There are a few points that need to be addressed here.

  1. Some users do not want nulls to always be forced to the bottom of the sort. (see sortService.sortData assumes that users want to sort nulls to bottom  #545)
  2. When reversing the sort, nulls can creep back up to the top of the sort. (see https://github.com/angular-ui/ng-grid/blob/master/build/ng-grid.js#L447-L451)
  3. When users provide their own custom sortFn, they do not get the option of handling nulls.

I'm currently working with a date sort on a large dataset that has several nulls, and when I reverse the sort of my values, I get ~100 empty cells before the first real data and I can't coerce the grid or my data otherwise to fix this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions