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

fix(grid): Fix calculate height when initially grid has no data #3950 #3972

Merged
merged 35 commits into from
May 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5cd81aa
fix(grid): Fix calculate height when initially grid has no data #3950
mpavlinov Feb 21, 2019
6f70541
test(grid): Fixing grid loading indicator test #3950
mpavlinov Feb 21, 2019
f4d5e9a
Merge branch 'master' into mpavlov/issue-3950-master
mpavlinov Feb 21, 2019
8ccf517
fix(HierarchicalGrid): Additional fix for navigation when empty child…
Feb 22, 2019
5ec94f5
Merge branch 'master' into mpavlov/issue-3950-master
mpavlinov Feb 22, 2019
2f42103
test(grid): Solving a scenario where the grid height is in % #3950
mpavlinov Feb 24, 2019
74cc13c
Merge branch 'master' into mpavlov/issue-3950-master
mpavlinov Feb 24, 2019
4f46038
Merge branch 'master' into mpavlov/issue-3950-master
mpavlinov Feb 25, 2019
85326d7
Merge branch 'master' into mpavlov/issue-3950-master
mpavlinov Feb 25, 2019
8d36042
Merge branch 'master' into mpavlov/issue-3950-master
mpavlinov Feb 26, 2019
b4e84e9
Merge branch 'master' into mpavlov/issue-3950-master
mpavlinov Feb 27, 2019
5cc9aeb
Merge master into mpavlov/issue-3950-master
mpavlinov Feb 27, 2019
fe0be95
Merge branch 'master' into mpavlov/issue-3950-master
mpavlinov Feb 28, 2019
d7eb102
Merge branch 'master' into mpavlov/issue-3950-master
mpavlinov Mar 3, 2019
6cb13ed
Merge branch 'master' into mpavlov/issue-3950-master
mpavlinov Mar 6, 2019
dc20d21
Merge branch '7.2.x' into mpavlov/issue-3950-master
mpavlinov Mar 12, 2019
d03e3ae
Merge branch '7.2.x' into mpavlov/issue-3950-master
mpavlinov Mar 14, 2019
29d857c
Merge branch '7.2.x' into mpavlov/issue-3950-master
mpavlinov Apr 23, 2019
ca540d6
Merge branch '7.2.x' into mpavlov/issue-3950-master
mpavlinov Apr 23, 2019
d678e46
Merge branch '7.2.x' into mpavlov/issue-3950-master
mpavlinov Apr 23, 2019
fa501d4
Merge branch '7.2.x' into mpavlov/issue-3950-master
mpavlinov Apr 23, 2019
978edc2
chore(*): Fixing wrong merge
mpavlinov Apr 23, 2019
aa7c14c
test(grid): HGrid remote LOD scenario shrinks the row islands #3950
mpavlinov Apr 24, 2019
92c3881
Merge branch '7.2.x' into mpavlov/issue-3950-master
mpavlinov May 7, 2019
ff9b1cc
Merge branch '7.2.x' into mpavlov/issue-3950-master
mpavlinov May 8, 2019
1a62f1c
chore(*): Removing default height null for child layouts
mpavlinov May 9, 2019
c69497a
chore(*): Updating tests to reflect the new row-island default
mpavlinov May 9, 2019
52130c9
Merge branch '7.2.x' into mpavlov/issue-3950-master
mpavlinov May 9, 2019
3ed8e5f
chore(*): Reverting the horizontal scroll visibility check
mpavlinov May 10, 2019
02a288d
Merge branch '7.2.x' into mpavlov/issue-3950-master
kdinev May 10, 2019
3a96a4f
Merge branch '7.2.x' into mpavlov/issue-3950-master
mpavlinov May 13, 2019
bade3f3
chore(*): Reseting widths cache when columns get recalculated
mpavlinov May 13, 2019
9f931aa
chore(*): New logic for row island height calculation
mpavlinov May 16, 2019
adb87d3
Merge branch '7.2.x' into mpavlov/issue-3950-master
mpavlinov May 16, 2019
643e575
Merge branch '7.2.x' into mpavlov/issue-3950-master
mpavlinov May 16, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3528,7 +3528,7 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
* Sets this._height
*/
protected _derivePossibleHeight() {
if ((this._height && this._height.indexOf('%') === -1) || !this._height || !this.isAttachedToDom) {
if ((this._height && this._height.indexOf('%') === -1) || !this._height || !this.isAttachedToDom || this.rowBasedHeight === 0) {
return;
}
if (!this.nativeElement.parentNode || !this.nativeElement.parentNode.clientHeight) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,26 +275,31 @@ describe('IgxGrid Component Tests', () => {

const grid = fixture.componentInstance.grid;
const gridBody = fixture.debugElement.query(By.css(TBODY_CLASS));
const domGrid = fixture.debugElement.query(By.css('igx-grid')).nativeElement;

// make sure default width/height are applied when there is no data
expect(domGrid.style.height).toBe('100%');
expect(domGrid.style.width).toBe('100%');

// Check for loaded rows in grid's container
fixture.componentInstance.generateData(30);
fixture.detectChanges();
tick(1000);
expect(parseInt(window.getComputedStyle(gridBody.nativeElement).height, 10)).toBeGreaterThan(1000);
expect(parseInt(window.getComputedStyle(gridBody.nativeElement).height, 10)).toBe(548);

// Check for empty filter grid message and body less than 100px
const columns = fixture.componentInstance.grid.columns;
grid.filter(columns[0].field, 546000, IgxNumberFilteringOperand.instance().condition('equals'));
fixture.detectChanges();
tick(100);
expect(gridBody.nativeElement.textContent).toEqual(grid.emptyFilteredGridMessage);
expect(parseInt(window.getComputedStyle(gridBody.nativeElement).height, 10)).toBeLessThan(100);
expect(parseInt(window.getComputedStyle(gridBody.nativeElement).height, 10)).toBe(548);

// Clear filter and check if grid's body height is restored based on all loaded rows
grid.clearFilter(columns[0].field);
fixture.detectChanges();
tick(100);
expect(parseInt(window.getComputedStyle(gridBody.nativeElement).height, 10)).toBeGreaterThan(1000);
expect(parseInt(window.getComputedStyle(gridBody.nativeElement).height, 10)).toBe(548);

// Clearing grid's data and check for empty grid message
fixture.componentInstance.clearData();
Expand Down