TIming issue with gridMenuScope
"Asked to addToGridMenu, but gridMenuScope not present. Timing issue? Please log issue with ui-grid"
Been using ui-grid (ui-grid - v3.0.1 - 2015-07-17) for a while, large application, lots of grids in use, but just recently started seeing the above error pop up in the console. When it pops up, there are always 2 instances. I've tried to duplicate it in JFiddle, but all the examples I try don't get the error. It's not very predictable and doesn't seem to be causing any issues that I am aware of. Any ideas?
I wrote that warning to use in my code - check the code base but my recollection was that it happened when I tried to add items to the grid menu before the grid had initialised. It doesn't break the grid, but means your menu items don't get added, so I put a warning in. I seem to recall in my app that it turned out to be happening when I was destroying the page (which was somewhat counter intuitive).
Hi Paul, That's the part that is driving me nuts. The grid menu is present and accounted for, nothing seems out of place. The error occurs when we initialize the page, but the gridMenu and even the subContextMenu are all fine. It doesn't happen every time, but when it does happen, it's on initialization. Head-scratcher for sure. I'll keep poking around, if I figure it out, I'll let you know.
Ted
On Thu, Oct 29, 2015 at 1:12 PM, Paul [email protected] wrote:
I wrote that warning to use in my code - check the code base but my recollection was that it happened when I tried to add items to the grid menu before the grid had initialised. It doesn't break the grid, but means your menu items don't get added, so I put a warning in. I seem to recall in my app that it turned out to be happening when I was destroying the page (which was somewhat counter intuitive).
— Reply to this email directly or view it on GitHub https://github.com/angular-ui/ui-grid/issues/4596#issuecomment-152252508 .
You could try the old standby of initialising the page, then wait one $timeout, then load the menu. Some of our initialisation doesn't run immediately.
Warped minds think alike, I just put a $timeout on the grid initialization to try.
Nope didn't fully work . . . seemed to reduce the instances of the error, at least I think it did, but it did not eliminate. If I get bored I might try again, but since it doesn't seem to be causing an actual problem, going to table it for now.
I've recently encountered this error also. I don't explicitly call addToGridMenu, so there's no code for me to change; I do define gridMenuCustomItems. Not sure if that's involved or not.
any updates on this? I'm getting the same error, even after a $timeout
Is there any update? Same error I got it.
I started getting this message after adding the ui-grid-exporter and supporting scripts. I haven't had a chance to dig into it yet, but thought I'd mention it here. As stated above by PaulL1, it doesn't break the grid and the export menu items do get added to the grid menu.