Author Topic: Error while accessing context menu in recreated grid  (Read 1993 times)

Digitalsoft

  • Pro OEM
  • Newbie
  • *
  • Posts: 49
    • View Profile
Error while accessing context menu in recreated grid
« 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

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Error while accessing context menu in recreated grid
« Reply #1 on: June 23, 2020, 07:18:20 pm »
I'm looking into it.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Error while accessing context menu in recreated grid
« Reply #2 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

Digitalsoft

  • Pro OEM
  • Newbie
  • *
  • Posts: 49
    • View Profile
Re: Error while accessing context menu in recreated grid
« Reply #3 on: June 24, 2020, 11:49:14 am »
great, it works!