Results 1 to 4 of 4

Thread: Error occurs on grid multiple selections

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Apr 2017
    Posts
    8

    Default Error occurs on grid multiple selections

    SENCHA Version




    • Ext 6.5.3.6





    Browser versions tested against:




    • [*Chrome (64-bit)]





    Description:




    • After making a selection in grid and dragging cursor to highlight additional cells past grid component, "Uncaught TypeError: Cannot read property 'length' of undefined" error occurs .




    Steps to reproduce the problem:




    • Create a populated grid
    • Select Cell in grid
    • Using drag ability in mouse with left button, select additional cells
    • Continue dragging selection past grid outer border
    • Encounter error





    The result that was expected:




    • Multiple selections without error





    The result that occurs instead:




    • Console error message "Uncaught TypeError: Cannot read property 'length' of undefined"




    Stand alone test case:






  2. #2
    Sencha - Forum Administrator
    Join Date
    Sep 2017
    Posts
    1,006

    Default

    Thank you so much for your post. I apologize for the delay. I have shared this with the support staff to look into at their earliest convenience. Your patience is greatly appreciated! We do suggest using the support portal when you need assistance with a capability of a Sencha product, you have identified a situation where a products behavior is inconsistent with the product documentation and might indicate a software bug, or when the communication between you and Sencha needs to be private.

    Thanks again,

    Michele


  3. #3
    Ext Support Team
    Join Date
    Jan 2018
    Posts
    569

    Default

    Hello,

    Please see an override below for this issue:

    Ext.override(Ext.grid.CellContext, {
    setRow: function(row) {
    var me = this,
    dataSource = me.view.dataSource,
    oldRecord = me.record,
    count;


    if (row != undefined) {
    // Row index passed, < 0 meaning count from the tail (-1 is the last, etc)
    if (typeof row === 'number') {
    count = dataSource.getCount();
    row = row < 0 ? Math.max(count + row, 0) : Math.max(Math.min(row, count - 1), 0);


    me.rowIdx = row;
    me.record = dataSource.getAt(row);
    }
    // row is a Record
    else if (row.isModel) {
    me.record = row;
    me.rowIdx = dataSource.indexOf(row);
    }
    // row is a grid row, or Element wrapping row
    else if (row.tagName || row.isElement) {
    me.record = me.view.getRecord(row);


    // If it's a placeholder record for a collapsed group, index it correctly
    me.rowIdx = me.record ? (me.record.isCollapsedPlaceholder ? dataSource.indexOfPlaceholder(me.record) : dataSource.indexOf(me.record)) : -1;
    }
    }
    if (me.record !== oldRecord) {
    me.generation++;
    }
    return me;
    },


    setColumn: function(col) {
    var me = this,
    colMgr = me.view.getVisibleColumnManager(),
    oldColumn = me.column;


    // Maintainer:
    // We MUST NOT update the context view with the column's view because this context
    // may be for an Ext.locking.View which spans two grid views, and a column references
    // its local grid view.
    if (col != undefined) {
    if (typeof col === 'number') {
    me.colIdx = col;
    me.column = colMgr.getHeaderAtIndex(col);
    } else if (col.isHeader) {
    me.column = col;
    // Must use the Manager's indexOf because view may be a locking view
    // And Column#getVisibleIndex returns the index of the column within its own header.
    me.colIdx = colMgr.indexOf(col);
    }
    }
    if (me.column !== oldColumn) {
    me.generation++;
    }
    return me;
    },


    });
    Regards,
    Kumar
    Sencha Support.

  4. #4
    Sencha User
    Join Date
    Dec 2012
    Posts
    1

    Default

    Quote Originally Posted by rakumar View Post
    Hello,

    Please see an override below for this issue:


    Regards,
    Kumar
    Sencha Support.
    Hi Kumar,
    your code is not valid.

    I retested this fix but this bug reproduce again:


    Ext JS 7.0.0
    https://fiddle.sencha.com/#view/editor&fiddle/2uvs

    Ext JS 6.7.0
    https://fiddle.sencha.com/#view/editor&fiddle/2uvr

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •