Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
igGrid - Updating - Stop Enter Key from Submitting/Saving
posted

I am using the igGrid edit dialog, and when editing text in a text box, when i hit return, the dialog is interpreting that as save. I want save to happen only during the Done button click. I would like return to acutally enter a new line in the text field, not save.

Additionally, I have the text field to be setup using multiline in the ColumnUpdatingSettings config, but the control is only on one line. How can i get the input field to wrap text.

ColumnSettings = new List<ColumnUpdatingSetting>() {
        new ColumnUpdatingSetting() { ColumnKey = "NoteText", EditorType = ColumnEditorType.Text, TextEditorOptions = new TextEditorModel(){  TextMode = TextEditorTextMode.Multiline  }  },
}

Parents
  • 29417
    Offline posted

    Hello Caty,

     Thank you for posting in our forum. 

    You can prevent the editRowEnding event when Enter is hit, for example:

      editRowEnding: function(evt, ui){
                  if (evt.key === "Enter")  return false;
                }

     For the multi-line editor, please make sure when defining the editor’s template that the type of the target element is not input.

    You can set it to div instead, for example: 

            <tr>
                <td style="text-align:right;color:#777;"><strong>${headerText}</strong></td>
                <td><div data-editor-for-${key}="true" /></td>
            </tr>
        

     

    Let me know if that solves your issues. 

    Regards,

    Maya Kirova

Reply Children