1. #1
    Sencha User
    Join Date
    Oct 2012
    Location
    India
    Posts
    15
    Vote Rating
    1
    saurabh0683 is on a distinguished road

      0  

    Default Adding new row in grid creates issue in selection model while editing

    Adding new row in grid creates issue in selection model while editing


    Hi,

    1. i have created grid with editable cell using NumberField class.
    2. grid is been in set for SINGLE selection mode
    3. then i added KeyDownHandler for NumberField, in order to navigate from cell to cell setting their editing mode
    4. this all works fine for existing rows
    5. but when i add new rows dynamically and then do same editing and navigation, grid show selection of multiple row(for newly added rows only). Please check out screenshot.

    can any body suggest what could be wrong?
    Attached Images

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,717
    Vote Rating
    89
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    I've moved this out of the Bugs forum into Discussion, because while there might be a bug here, it seems more likely that the bug is in your code. When filing a bug, please use the template.

    When asking for help, please post the code you've tried to use - if there is a problem with your code, we won't be able to see it just from the steps you've listed.

    Selection model issues like this almost always relate to not having a unique key for each row in the ListStore. From ModelKeyProvider:
    Code:
      /**
       * Gets a non-null key value that maps to this object. Keys must be consistent and
       * unique for a given model, as a database primary key would be used.
       */
      String getKey(T item);
    Make sure each item is getting a unique key - the selection model uses that key to decide what is selected. If more than one item have the same key, then more than one item will be selected.

Thread Participants: 1

Tags for this Thread