ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

Built in search box does not find nested data

Open horduringi opened this issue 13 years ago • 2 comments

Hi

I am using column definitions and have nested objects in Json format. I made minimal changes to your Column Definitions Example, to demonstrate.

I changed myData to have name as an object that includes first and last name:

$scope.myData = [{name:{first: "Moroni", last: "Jones"}, age: 50},
                 {name:{first: "Tiancum", last: "Smith"}, age: 43},
                 {name:{first: "Jacob", last: "Brian"}, age: 27},
                 {name:{first: "Nephi", last: "Nebula"}, age: 29},
                 {name:{first: "Enos", last: "Duos"} , age: 34}];

I changed the column definitions:

columnDefs: [{field: 'name.first', displayName: 'First name'}, {field: 'name.last', displayName: 'Last name'}, {field:'age', displayName:'Age'}]

And added:

showFilter: true

The result can be viewed in plunker.

It is possible to filter by columns with nested data if column is specified, e.g. "First name: M" will display Moroni and Tiancum, but only "M" will display nothing.

Thank you for ng-grid, it's awesome!

horduringi avatar Jul 16 '13 10:07 horduringi

This looks like a duplicate of https://github.com/angular-ui/ng-grid/issues/531. In short first and last name should work in 2.0.7 now. (It appears that they do) But I notice that filtering based on age still fails. Either way the related issue is still open. I will mention this on the other issue.

zstlaw avatar Jul 16 '13 19:07 zstlaw

Closing, since it is a dupe of #531

roblarsen avatar Aug 15 '13 15:08 roblarsen