Results 1 to 4 of 4

Thread: Cant remove last entry of a grid by using custom context menu

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Ext JS Premium Member
    Join Date
    Jun 2009
    Posts
    63

    Default Cant remove last entry of a grid by using custom context menu

    Fiddle:

    https://fiddle.sencha.com/#fiddle/od1
    right click on the link (important!) and then on delete on all four entries


    Ext version tested:

    • 5.1.0.107
    • 5.1.1.451

    Browser versions tested against:
    • Chrome
    • Firefox
    • IE11

    Description:
    • focus management in grid navigation model has a bug that prevents one from deleting last entry of grid after it just lost focus, if an dom element inside the cell but not the cell itself was last focused
    • not being able to delete this entry is propably only one of many impacts of this bug

    Steps to reproduce the problem:
    • build grid
    • add custom context menu that can delete entries
    • use it

    The result that was expected:

    • all entries can be removed

    The result that occurs instead:
    • last entry throws exception

    Exception:
    Code:
    Uncaught TypeError: Cannot read property 'getSelectionModel' of undefined
    Ext.grid.NavigationModel#setPosition:197

    Fix:
    After hours of searching I found the problem. Ext.grid.NavigationModel#lastFocused gets lost if Ext.view.Table#onFocusEnter registers a focus inside the grid but not the cell itself. The navigationModel.position then points to the navigationModel.lastFocused and when the position is cleared later => the lastFocused gets cleared, which certainly isnt what we want then.

    In Ext.view.Table#onFocusEnter replace the following line of code
    Code:
    navigationModel.position = navigationModel.lastFocused;
    with the following
    Code:
    navigationModel.position = navigationModel.lastFocused.clone();

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985

    Default

    Thanks for the report and suggested fix. I do indeed see the issue with 5.1.0 and 5.1.1, but it seems to have been fixed. I'm not able to recreate using nightlies of 5.1.2 or 6.0.0.

  3. #3
    Ext JS Premium Member
    Join Date
    Jun 2009
    Posts
    63

    Default

    Can confirm: fixed in 5.1.2.748. Thanks!

  4. #4
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985

    Default

    Thanks for the confirmation!

Similar Threads

  1. Replies: 5
    Last Post: 21 Feb 2014, 11:56 AM
  2. Remove column "hider" from a Grid's header context menu
    By britterm in forum Sencha GXT Q&A
    Replies: 3
    Last Post: 4 Dec 2013, 1:59 AM
  3. Remove the context menu in the grid's column header
    By alonk in forum Sencha GXT Q&A
    Replies: 5
    Last Post: 11 Dec 2012, 12:49 AM
  4. Replies: 2
    Last Post: 19 May 2010, 12:38 PM
  5. adding custom context menu for grid
    By snorbicet in forum Ext GWT: Help & Discussion (1.x)
    Replies: 3
    Last Post: 23 Feb 2010, 8:05 PM

Posting Permissions

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