igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

igx-grid: When igx-grid is bound to data via HttpClient, igx-grid gets extra blank area.

Open tkiryu opened this issue 8 years ago • 1 comments

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

image

Expected result

igx-grid has no extra blank area.

Attachments

igx-grid-app.zip

tkiryu avatar Mar 20 '18 09:03 tkiryu

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>

zdrawku avatar Mar 27 '18 12:03 zdrawku