Using Ag-Grid 8.1.1 (free version) and AngularJS 1.5.8
I have an editable grid.
The default behavior of the grid is Use home and end to go to the first and last rows. (See https://www.ag-grid.com/javascript-grid-keyboard-navigation/?framework=angularjs)
My problem is: while editing a cell, I press the End key to go to the end of the input. And the grid scroll down to the last row.
How can I override this behavior ?
What I did so far:
onCellEditingStarted: function(gridEvent) {
$($element).on('keydown.grid', function(jqueryEvent) {
jqueryEvent.stopPropagation();
jqueryEvent.preventDefault();
if (e.key === 'End') {
myCustomFunction();
}
});
},
myCustomFunction is called, but the default behavior of the grid is not stoped by e.stopPropagation(); e.preventDefault();
event.stopPropagation(); event.preventDefault();instead ofe.stopPropagation(); e.preventDefault();? - Akasheventis not a JQuery event but an ag-grid event. It is build like this{node: RowNode, data: Object, value: "Nombre", rowIndex: 1, column: Column…}. I change the name in my code. - EloHailwidis