Uncaught TypeError: Cannot read property 'rowIndex' of undefined #298

Closed
NathanWalker opened this Issue Apr 2, 2013 · 11 comments

Comments

Projects
None yet
9 participants

Uncaught TypeError: Cannot read property 'rowIndex' of undefined ng-grid.js
ngMoveSelectionHandler
(anonymous function)
b.event.dispatch
v.handle

This happens randomly.

Using these gridOptions:

s.gridOptions = {
    data : 'files',
    multiSelect:true,
    columnDefs: [
      {
        field: 'name',
        displayName: 'Name',
        cellTemplate:'<div class="file-title" data-ng-bind-html="row.getProperty(col.field)"></div>'
      }
    ]
  };
Member

timothyswt commented Apr 2, 2013

what line of code?

On Tue, Apr 2, 2013 at 9:12 AM, Nathan Walker notifications@github.comwrote:

Uncaught TypeError: Cannot read property 'rowIndex' of undefined ng-grid.js
ngMoveSelectionHandler
(anonymous function)
b.event.dispatch
v.handle

This happens randomly.


Reply to this email directly or view it on GitHubhttps://github.com/angular-ui/ng-grid/issues/298
.

-Tim Sweet

Member

timothyswt commented Apr 8, 2013

or what version are you running?

version is 2.0.3.

Not sure the line of code. Next time it happens, I'll get the line number and post back.

I think I got the same. But it's pretty much random.

$scope.selectionProvider.lastClickedRow is undefined at ng-grid.debug.js (line 43) (Compiled At: 04/08/2013 17:19)

pilow commented Apr 10, 2013

I am running 2.0.0 and get the same error.

Uncaught TypeError: Cannot read property 'rowIndex' of undefined ng-grid-2.0.0.js:9
ng.moveSelectionHandler ng-grid-2.0.0.js:9
(anonymous function) ng-grid-2.0.0.js:149
b.event.dispatch jquery-1.9.js:3
v.handle jquery-1.9.js:3

Its totally random and doesnt seem to impact other functionnality ...

I got the following error very often: here is the details (version : 2.0.4) , Saw the this error in chrome console:

Uncaught TypeError: Cannot read property 'rowIndex' of undefined ng-grid-2.0.4.min.js:1
w ng-grid-2.0.4.min.js:1
(anonymous function) ng-grid-2.0.4.min.js:1
jQuery.event.dispatch jquery.js:3074
elemData.handle jquery.js:2750

Hi,
I have the same error with a simple nggrid.
{code}

$scope.myData = [{name: "Moroni", age: 50},
{name: "Tiancum", age: 43},
{name: "Jacob", age: 27},
{name: "Nephi", age: 29},
{name: "Enos", age: 34}];
$scope.gridOptions = { data: 'myData' };
{/code}

it will be raised when the grid gets the initial focus by keyboard or click into gridpane without selecting a row.

and once if this exception is thrown, keyboard events doesnt work until page reload.

see http://jsfiddle.net/derrobin/ydsuZ/3/

i solved it by changing line 43 in build/ng-grid.debug.js

from

    rowIndex = $scope.selectionProvider.lastClickedRow.rowIndex,

to

    rowIndex = $scope.selectionProvider.lastClickedRow == undefined
        ? 1 : $scope.selectionProvider.lastClickedRow.rowIndex,
Member

c0bra commented May 14, 2013

Awesome; thanks for the diagnosis!

@derrobin : can we know in which version of ng-grid this problem is going to be resolved.

jonricaurte referenced this issue Jun 28, 2013

Merged

2.0.7 #511

@jonricaurte jonricaurte added a commit that referenced this issue Jun 29, 2013

@jonricaurte jonricaurte Making fixes for #341 #298 #397
Still need to look into the colDef.width merge more.
119a3ce
Member

jonricaurte commented Jun 29, 2013

Fixed in 2.0.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment