1

when inline-editing a text column in the w2ui.grid the ENTER key applies the change AND starts editing one row below.

How can I prevent the editing of the line below, but only apply the changes to the current row?

Thank you.

Udo VV
  • 63
  • 1
  • 6

1 Answers1

0

You can do this by cancelling the edit event if the previous keycode was ENTER.

w2ui.grid.onEditField = function(event){
  if(event.originalEvent.keyCode === 13){
     event.preventDefault();
  }
};   

fiddle: http://jsfiddle.net/ty77umx1/1/

Mike Scotty
  • 10,530
  • 5
  • 38
  • 50