igniteui-angular
igniteui-angular copied to clipboard
igx-grid: When igx-grid is bound to data via HttpClient, igx-grid gets extra blank area.
Description
When igx-grid is bound data via HttpClient, igx-grid gets extra blank area.
Steps to reproduce
Run the attached sample
In the sample. I implemented as follows.
// home.component.ts
ngOnInit() {
this.http.get<any[]>('/assets/data.json')
.subscribe(data => {
this.data = data.splice(0, 10);
});
}
<!-- home.component.html -->
<igx-grid [data]="data" width="600px">
<igx-column width="200px" field="EmployeeID" header="EmployeeID" dataType="string"></igx-column>
<igx-column width="200px" field="FirstName" header="FirstName" dataType="string"></igx-column>
<igx-column width="200px" field="LastName" header="LastName" dataType="string"></igx-column>
</igx-grid>
Result

Expected result
igx-grid has no extra blank area.
Attachments
Hm, igxGrid is taking the parent height when grid's "height" property is not specified, although this is not the case with the provided sample, something is broken. We are currently adding some style enchantments, once we merge them to master I am going to review the sample again.
For a temporary solution you can set height to 100%
<igx-grid [data]="data" width="600px" height="100%">
<igx-column width="200px" field="EmployeeID" header="EmployeeID" dataType="string"></igx-column>
<igx-column width="200px" field="FirstName" header="FirstName" dataType="string"></igx-column>
<igx-column width="200px" field="LastName" header="LastName" dataType="string"></igx-column>
</igx-grid>