I hope to add new row automatically, when the DownArrow Key is pressed in the last row.
Following code works well when there is no filter used. But after filtering, pressing DownArrow Key couldn't add new row automatically when the cell in last row is selected. Would you like to provide help kindly?
beforeCellKeyDown: function( event, ui ) {
if(event.key=="Delete" ){
var nodes = [];
var type = this.Selection().address()[0].type
if(type == 'row'){
var Sel = this.Selection().eachRow(function(rowData){
nodes.push(rowData);
})
this.deleteNodes(nodes);
return false; //to prevent default behaviour.
}
}
if(!this.isValid( { rowData: ui.rowData } ).valid)
{return;}
if(event.key=="ArrowDown" && ui.rowIndx==this.getTotalRows()-1){
var rowIndx = this.addRow({ rowData: defaultRowData(), checkEditable: true });
// this.goToPage({ rowIndx: rowIndx });
debugger;
this.editFirstCellInRow({ rowIndx: rowIndx });
}
},