Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

Manually commit cell change and move cell

$
0
0

I am using in-line editing of data in the kendo grid.  When I am editing a cell I want to do the following:

  1. Press Enter should commit the cell value and close the edit.
  2. Press Tab should commit the cell value and move to the next cell.
  3. Press Escape should cancel the cell change (and revert the value) and stop editing.

At the minute I've tried the following from bits online:

01.$(function() {
02. 
03.            $("#mygrid").keypress(function(e) {
04. 
05.                varkeyCode = e.keyCode || e.which;
06.                if(keyCode == 13) {
07.                    debugger;
08.                    vargrid = $("#mygrid").data("kendoGrid");
09.                    varcurCell = grid.table.find(".k-edit-cell");
10.                    grid.saveRow();
11.                    grid.editCell(curCell.next()); // To move the cursor to the next cell and put the cell in edit mode
12.                    grid.select(curCell.next()); // To select the next cell
13.                    //grid.focus(curCell.next()); // To set focus on to next cell  
14.                    e.preventDefault(); // To prevent the default behavior of the enter key press
15.                }
16.            });
17.        });

I cannot see any method on how to accept the grid cell changes.

Any help on how to accomplish the above greatly appreciated.

Andez


Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>