1. #1
    Ext User
    Join Date
    Apr 2008
    Posts
    13
    Vote Rating
    0
    geverend is on a distinguished road

      0  

    Default Mouseover not showing first row

    Mouseover not showing first row


    I'm trying to show the contents of a GridPanel row in an different div when hovering over the row.

    I've gotten it working with the following mosueover function, but for some reason, the first row never returns a result:

    Code:
    var onMouseover = function(e, t) {
        var grid = Ext.getCmp('myGrid');
        var row;
     
        if((row = grid.getView().findRowIndex(t)) != false){
            var record = grid.store.getAt(row);
        }   
    
        if(record) {
            showDetails(record);
        }
    
    }
    it seems that findRowIndex returns null when moving over the first row.

    Any suggestions?

    Thanks.

  2. #2
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Vote Rating
    77
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    (0 == false)


    try:

    row = grid.getView().findRowIndex(t)) > 0

  3. #3
    Ext User
    Join Date
    Apr 2008
    Posts
    13
    Vote Rating
    0
    geverend is on a distinguished road

      0  

    Default


    Ah yes-- the problem is that the first row has index 0.

    changing to
    row = grid.getView().findRowIndex(t)) !== false

    fixed the problem.

Thread Participants: 1