Kendo-angular: Locked column height is not updated when setting Grid data programmatically

Created on 18 May 2017  路  11Comments  路  Source: telerik/kendo-angular

I just tested the grid with automatic binding (very clean solution) and fixed columns. It's seems that the locked columns don't follow the height of columns which are not locked.
Plunker : http://plnkr.co/edit/p9YbkzpnMJhE3JCln7sw?p=preview.
The result is something like this :
capture

Bug grid

Most helpful comment

Hey @ChrisProlls ,

The behavior in question is due to the fact that when setting the data programmatically via the Grid component data field, the change detection for the Grid Component will not be triggered. And the component will not be notified in order to run the routine for syncing the rows height. To overcome this Grid's onDataChange method should be called (it is called automatically by the DataBindingDirective's rebind method, however with the custom directive in question it is overridden):

     public ngOnInit(): void {
        this.serviceSubscription = this.products.subscribe((result) => {
            this.grid.data = result;
            this.grid.onDataChange();//<<<<<<<
        });

        super.ngOnInit();

        this.rebind(); 
    }

All 11 comments

Hey @ChrisProlls ,

The behavior in question is due to the fact that when setting the data programmatically via the Grid component data field, the change detection for the Grid Component will not be triggered. And the component will not be notified in order to run the routine for syncing the rows height. To overcome this Grid's onDataChange method should be called (it is called automatically by the DataBindingDirective's rebind method, however with the custom directive in question it is overridden):

     public ngOnInit(): void {
        this.serviceSubscription = this.products.subscribe((result) => {
            this.grid.data = result;
            this.grid.onDataChange();//<<<<<<<
        });

        super.ngOnInit();

        this.rebind(); 
    }

It works, thanks !

This should be fixed now, see plunkr.

Reproducible with the above plunker and kendo-angular-grid v.1.2.3
https://www.screencast.com/t/SU4HdZq6

Should be fixed in v1.2.4-dev.201707251109

Fix is available in the latest dev. version of @progress/kendo-angular-grid. To get this version, specify in package.json:
"@progress/kendo-angular-grid": "dev"

Fix shipped in v1.3.1

Seems to be broken again in
"@progress/kendo-angular-grid": "^3.12.1",

@kdubious can you give the development version a shot? We fixed something similar recently (https://github.com/telerik/kendo-angular/issues/2177).

Same issue, commented over in #2177, pasted below

--
Still an issues under these conditions:

  1. No Height set on grid & the data is loaded 'out-of-band' (setTimeout or a service call)
  2. Using [kendoDataBinding] and pageable='true' adds to the issue
    Here's a demo: https://stackblitz.com/edit/angular-trywwh

Seems to be working with the latest version, see updated demo.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

meriturva picture meriturva  路  19Comments

JohannesHoppe picture JohannesHoppe  路  15Comments

jiangen1016 picture jiangen1016  路  16Comments

simon11196 picture simon11196  路  17Comments

ilianiv picture ilianiv  路  19Comments