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

Binding to nested data #1

Open
brianlagunas opened this issue Jun 6, 2019 · 11 comments
Open

Binding to nested data #1

brianlagunas opened this issue Jun 6, 2019 · 11 comments
Labels
grid add sample to the grid component new sample Request a new sample be added

Comments

@brianlagunas
Copy link
Member

Need a sample that shows how to have a column data bound to a nested property of the underlying data item.

This example assumes a collection of objects that have a user property which is an object with it's own properties we wish to display in the grid.

{
id: 1,
companyName: "IG",
user: [
  {
    name: "brian",
    email: "something",
    registered: true
  },
 ],
}
<igx-column field=”user” header=”User Details”>
     <ng-template igxCell let-cell=”cell”>
          {{ cell.value.name }} | 
          {{ cell.value.email }} | 
          {{ cell.value.registered }} | 
     </ng-template>
</igx-column>
@brianlagunas brianlagunas added new sample Request a new sample be added grid add sample to the grid component labels Jun 6, 2019
@brianlagunas brianlagunas changed the title [Grid] Binding to nested data Binding to nested data Jun 6, 2019
@obSoftMind
Copy link

Hello
How I do to disaplay values of netested columns as
[
company: string
user : {
firstName:'value1',
name:'value2'
},{
firstName:'value3',
name:'value4'
}
How i do to dispaly user objects using Angular 8 and Infragistic grid
]

@zdrawku
Copy link
Collaborator

zdrawku commented Apr 27, 2020

If you are looking for complex data binding, check out the official documentation section on our website.

@obSoftMind
Copy link

Hello,
thank you very much for your answer.

In my case, i am looking for to dispaly Grid binding data of a nested objects.
E.g:
const localData = [{
company: string
user : {
firstName:'value1',
name:'value2'
}
}]

In the end, I want to have :
firstName | Name | column |...
value1 | value2 | data |...

Template :
<igx-grid [data]="localData ">


{{ cell.value}}



However, i shouldn't be feltring localData to have only the user. I want to bind to a localData.

Thank you in advance for your helpe

@brianlagunas
Copy link
Member Author

@obSoftMind
Copy link

Hello and thank's for your answer
In my case I juste wante to display one grid which reprenents the tested object, is it possible?

thank you

@brianlagunas
Copy link
Member Author

@omar-IT Yes, please see the link I provided.

@obSoftMind
Copy link

Hello,
I saw your link, thank you
I dont't want to have hierarchicalgrid, juste one grid to dispaly nested data,

@brianlagunas
Copy link
Member Author

brianlagunas commented Apr 27, 2020

@obSoftMind
Copy link

I am sorry
this exemple shows how to dispaly nested data in the same column. that's not what I want

@brianlagunas
Copy link
Member Author

Take the concepts shown in the sample and change them to achieve your desired results.

@obSoftMind
Copy link

thank you, i will do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grid add sample to the grid component new sample Request a new sample be added
Projects
None yet
Development

No branches or pull requests

3 participants