ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: Digitalsoft on June 23, 2020, 01:47:38 pm

Title: Error while accessing context menu in recreated grid
Post by: Digitalsoft on June 23, 2020, 01:47:38 pm
Team, For one of our requirement, we have tried to destroy the created PQ grid and re-created with new options. It seems like everything is fine except context menu option. When we right click in the grid cells there is an exception log in console window and the context menu functionality is not working but it was working fine in the initial grid creation. Screenshot attached for reference and created a sample in stackblitz link. Is it something to do with grid config or some other issue. Any thoughts/suggestions?
https://stackblitz.com/edit/paramquery-ng-locale-jhzff2 (https://stackblitz.com/edit/paramquery-ng-locale-jhzff2)
Title: Re: Error while accessing context menu in recreated grid
Post by: paramvir on June 23, 2020, 07:18:20 pm
I'm looking into it.
Title: Re: Error while accessing context menu in recreated grid
Post by: paramvir on June 23, 2020, 10:46:13 pm
Please add this just after this.grid.destroy(); to fix the error.

Code: [Select]
this.grid.destroy();
$(this.div.nativeElement).off('contextmenu')

https://stackblitz.com/edit/paramquery-ng-locale-gk7dmg?file=src/app/pqgrid.component.ts
Title: Re: Error while accessing context menu in recreated grid
Post by: Digitalsoft on June 24, 2020, 11:49:14 am
great, it works!