Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Stop DS Update when TextItem loses focus

    Using SC 8.2.

    I have a ListGrid with a column that has editable values. What I've noticed is that if I click in this column, the cell in the row I clicked becomes editable as I would expect. But when I click out of it, an update operation occurs (DS posts an update to the server). I'd like to block this operation -- I only want updates to occur if a user clicks a submit button or hits 'enter'. How do I do this?

    #2
    See listGrid editing overview, autoSaveEdits and editByCell.

    Comment


      #3
      I've set autoSaveEdits to false on my ListGrid. So now, I need to handle saving myself. To do this, I overrode editorExit and if the enter button was clicked, then I call grid.saveEdits(). This works fine. The problem I'm having is that I can't seem to figure out how to reset the text field to what it was before on a cancel event (which occurs when the user clicks out of the text area, or anything other than the enter button, really). I've tried calling discardEdits and cancelEditing but neither of these reset the value to what it was prior to editing, and cancelEditing results in my editorExit function getting called in a loop. How do I cancel and restore the value of the text field?

      Comment


        #4
        Problem solved. In editorExit, I call grid.clearEditValue(rowNum, colNum) to reset the value of my cell, and then I return true from the editorExit function.

        Comment

        Working...
        X