FlexGrid: keyActionEnter = MoveAcross without exiting edit mode

Posted by: sverrimo on 14 December 2017, 9:45 am EST

    • Post Options:
    • Link

    Posted 14 December 2017, 9:45 am EST

    Is there a way to move the cell edit over to the next column without exiting edit mode, when using

    keyActionEnter
    = ```

    MoveAcross

    
    It seems like it always goes out of edit mode when you hit ENTER, no matter what ```
    keyActionEnter
    ``` is set to.
    
    I am using vanilla JS.
    
    Here is an attempt of mine. I have been trying out different things for a few hours, so it may be a little messy, but it shows the problem:
    
    http://jsbin.com/yonikoqiga/1/edit?js,console,output
    
    1. Change "Type" column and hit Enter
    2. See that collection changed
    3. Change "Name" column and hit Enter
    4. See that collection changed again
    
    When the user changes Type, the Name dataMap is updated with new values. If the Name cell's current value is not present in the updated dataMap then I want to force the user to select a new value.
    
    I want to do all this while staying in edit mode, so the collection is only updated once.
    
    Is this possible?
  • Posted 15 December 2017, 3:33 am EST

    Hi,

    As per understanding, you would like to retain on Name column cell in edit mode if user enter incorrect value. You just need to handle cellEditEnded event as before. You only need to check if there is any error for current cell value. If yes, startEditing for cell. Please refer to updated sample:

    http://jsbin.com/xajuwijafe/edit?js,console,output

    ~Manish

  • Posted 15 December 2017, 5:04 am EST

    Hi Manish,

    The main problem I am having is that when the user changes the “Type” and then hits Enter the change to that cell is committed immediately, even though I have set “keyActionEnter” to mimic the behavior of TAB (which does not commit changes).

    The two values need to be saved together. The API I am using checks if is valid and fails if not.

    It is like Enter always commits changes, no matter what “keyActionEnter” is set to.

    Sverri

  • Posted 18 December 2017, 8:28 am EST

    Hi Sverri,

    For this, we need to override enter key behavior. Please refer to the updated sample for the same:

    http://jsbin.com/baqusacipe/1/edit?js,console,output

    ~Manish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels