Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conflit ng-grid / ui-router #1142

Closed
hepr opened this issue Apr 25, 2014 · 3 comments
Closed

conflit ng-grid / ui-router #1142

hepr opened this issue Apr 25, 2014 · 3 comments

Comments

@hepr
Copy link

hepr commented Apr 25, 2014

Hi,

I'm using ng-grid 2.0.9 with angular 1.2.15 with ui-router.

When I click link on page that have a ng-grid table I have this error :

TypeError: Cannot read property 'off' of null
at HTMLDivElement. (http://symeos.net/js/lib/ng-grid/ng-grid-2.0.9.debug.js:1008:31)
at HTMLDivElement.x.event.dispatch (http://symeos.net/js/lib/jquery/jquery.min.js:5:14129)
at HTMLDivElement.v.handle (http://symeos.net/js/lib/jquery/jquery.min.js:5:10873)
at Object.x.event.trigger (http://symeos.net/js/lib/jquery/jquery.min.js:5:13255)
at x.fn.extend.triggerHandler (http://symeos.net/js/lib/jquery/jquery.min.js:5:20857)
at e (http://symeos.net/js/lib/angular/angular.min.js:24:392)
at $.fn.(anonymous function) as remove
at Object.leave (http://symeos.net/js/lib/angular/angular.min.js:148:324)
at http://symeos.net/js/lib/angular-animate/angular-animate.min.js:14:341
at t (http://symeos.net/js/lib/angular-animate/angular-animate.min.js:10:115)

If I refresh this page with F5 I've no error.

Can you help me ?

Thanks

Herve

@hepr
Copy link
Author

hepr commented Apr 25, 2014

I found a fix :

line 952 in build/ng-grid.js

   grid.$topPanel.on('$destroy', function() {
           if(grid.$topPanel == null) // FIX ui-router
            return;

                grid.$topPanel.off('mousedown');

                if (grid.config.enableColumnReordering) {
                    grid.$topPanel.off('drop');
                }

                grid.$topPanel = null;
            });

Is it ok for you ?

@sdum
Copy link

sdum commented Apr 25, 2014

I have the same issue with the classic angular-route on route change. The fix above seems to work.

@c0bra c0bra closed this as completed in c50e29d Apr 25, 2014
@c0bra
Copy link
Contributor

c0bra commented Apr 25, 2014

This should be fixed in 2.0.10.

tradingscreen pushed a commit to tradingscreen/ng-grid that referenced this issue Jun 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants