Cell Edit Template does not work with ChangeDetectionStrategy.OnPush

Posted by: igor on 27 June 2019, 10:50 am EST

    • Post Options:
    • Link

    Posted 27 June 2019, 10:50 am EST

    Hello,

    When upgrading to the latest version of Wijmo I have noticed that my cell edit templates have stopped working. They render vanilla HTML markup but not Angular syntax.

    After some investigation, I’ve found out that if I switch the ChangeDetectionStrategy from OnPush to Default, it gets fixed, but that is a change I cannot afford on certain large grids.

    A similar problem has been reported before on https://www.grapecity.com/forums/wijmo/flex-grid---issue-in-displ_2 but the posted workaround did not work.

    Here is a minimal repro with the workaround applied but not working: https://stackblitz.com/edit/angular-vsusht

    Thanks.

  • Posted 28 June 2019, 3:15 am EST

    Could you please try using the beginningEdit event instead of updatedView event:

      init(grid) {
        grid.beginningEdit.addHandler(() => this.cdRef.markForCheck())
      }
    

    You may refer to the updated sample below:

    https://stackblitz.com/edit/angular-ut3gcr

    Please tell us whether this solution solves your issue.

  • Posted 2 July 2019, 12:21 pm EST - Updated 3 October 2022, 3:11 pm EST

    Yes, that works. That will allow me to keep working on the upgrade. Do you guys have a plan/timeline to fix it?

    Thanks!

  • Posted 3 July 2019, 6:57 am EST

    Could you please let us know which wijmo version were you using before in which the issue did not exist so that I can pass this information to the dev team.

  • Posted 3 July 2019, 10:26 am EST

    I was at 20171.293.

    Thank you!

  • Posted 4 July 2019, 1:50 am EST

    Hi,

    We have forwarded a bug report for the same with internal tracking id 387385. We will give you an update as soon as the issue is fixed.

  • Posted 29 July 2019, 4:00 am EST

    Hi Igor,

    The issue has been fixed in the latest nightly build of Wijmo. You may verify the same using the sample below:

    https://stackblitz.com/edit/angular-pcfv3x

    PS: Nightly builds have not passed through the QA cycle as our release builds do. So, they are not suitable in the production environment.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels