Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
85
How to consume a webapi service with IgGrid and Angular2
posted

I'm experiencing problems with populating data in my IgGrid when I want to consume a WebApi service.

I have the following in my Angular2 component

getAllClientGroups() {

this.clientService.getClientGroup(0)
.subscribe(groups => {
this.clientGroups1 = groups;

},
err => {
console.log(err);
});
}

and I put this.clientGroups1 in my datasource for the IgGrid:

this.gridOptions = {
autoCommit: true,
width: "100%",
height: "400px",
autoGenerateColumns: false,
dataSource : this.clientGroups1,
columns: [
{ key: "id", headerText: "Id", width: "50px", dataType: "number" },
{ key: "code", headerText: "Code", width: "250px", dataType: "string" },
{ key: "description", headerText: "Omschrijving", width: "250px", dataType: "string" }
],
primaryKey: "id"
]
}

But nothing is showing in my IgGrid. What do I have to do to get this working?