Is there a dhtmlxGrid keyboard shortcut so that, when editing a cell, pressing it will save the cell and edit the cell below it? Like “tab” which moves rightward, but moving downward instead.
If not: I am a user of software that embeds dhtmlxGrid. I can’t edit the software to add this keyboard shortcut, but I can write a Chrome extension for frustrated users like me. When I tried adding the following jQuery script, I got the error “TypeError: Cannot call method ‘wasDblClicked’ of undefined”:
// Whenever someone presses Enter in a cell editing input box,
$(document).on("keydown", "input.dhx_combo_edit", function(e) {
if (e.keyCode !== 13) return; // Only run if Enter was pressed
// Find the cell below the currently selected cell,
var cell = $(".cellselected");
var row = cell.closest("tr");
var index = row.children().index(cell);
var targetCell = row.next().children().eq(index);
// ... and double-click that cell.
targetCell.dblclick(); // This generates the error message.
});
Can someone point me to what I’m missing to trick dhtmlxGrid into thinking that the cell was actually double clicked? FWIW, when I manually run $(".cellselected").dblClick() in the page itself (not in a Chrome extension) the cell successfully becomes editable.
Thanks in advance!
Michael