ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

TIming issue with gridMenuScope

Open tedhohio opened this issue 11 years ago • 9 comments

"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?

tedhohio avatar Oct 29 '15 13:10 tedhohio

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).

PaulL1 avatar Oct 29 '15 17:10 PaulL1

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 .

tedhohio avatar Oct 29 '15 17:10 tedhohio

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.

PaulL1 avatar Oct 29 '15 18:10 PaulL1

Warped minds think alike, I just put a $timeout on the grid initialization to try.

tedhohio avatar Oct 29 '15 18:10 tedhohio

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.

tedhohio avatar Oct 29 '15 20:10 tedhohio

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.

jim-powers avatar Nov 23 '15 17:11 jim-powers

any updates on this? I'm getting the same error, even after a $timeout

destradafilm avatar May 09 '17 21:05 destradafilm

Is there any update? Same error I got it.

sirajudeen013 avatar Dec 18 '17 07:12 sirajudeen013

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.

wes-baldwin avatar Feb 26 '18 20:02 wes-baldwin