Skip to content

Filtering doesn't work when fields are object properties #531

@esheffield-ivantage

Description

@esheffield-ivantage

Filtering doesn't seem to work when the data in the grid consists of nested objects. For example, suppose you have data that looks like this:

$scope.myData = [{fields: {name: "Moroni", age: 50}},
                 {fields: {name: "Tiancum", age: 43}},
                 ...];

You can configure the column definitions so that the data displays properly in the grid:

columnDefs:[
  {
    field: "fields['name']",
    displayName: "Name"
  },
  ...
]

... but any attempts at filtering with the search box will result in no items showing in the grid. Presumably this is because ng-grid filters strings, not objects. Is there a way to get filtering to work in such a case? Here's a Plunker demonstrating this example: http://plnkr.co/edit/l2J1S9

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