Hello everybody!
I wonder if it is possible to add several values (a list for example) in one cell of an igGrid?
In fact, for a single ID of a person, there are several addresses.
I would like keep ID of address added to the entity of the person and at the same time, I would like display all these addresses in on cell.
Best regards,
F2O
Hello F2O,
This can be achieved, but your model have to have all the addresses data (for example you may have a Address field of type List<Address>).
When configuring your igGrid you can use templating to create a list of the person addresses.
Here is an example:
var persons = [ {PersonID: "1", Addresses: [ {Address: "Address1"}, {Address: "Address2"}, {Address: "Address3"} ]}];
$("#grid1").igGrid({ width: "700px", primaryKey: "PersonID", columns: [ { headerText: "Person ID", key: "PersonID", dataType: "number"}, { headerText: "Addresses", key: "Addresses", dataType: "object", template: "<ul>{{each ${Addresses} }} <li>${Addresses.Address}</li> {{/each}}</ul>"} ], autoGenerateColumns: false, dataSource: persons});
Hope this helps,Martin PavlovInfragistics, Inc.
Thank you, Martin!
I used .RowTemplate() and it worked well but what you proposed, is better (and shorter).
Regards,