Closed AlexandrChazov closed 5 months ago
hmm are you sure about this? I actually don't know what that is for, I think @6pac added this (Ben do you have more info and can you do a review?). @AlexandrChazov if you do have more info of what that does then please add a description to the interface property because I didn't add one because I didn't know what it actually was for.
Yep, it should be an array of numbers. It allows codes that would normally be captured by the grid to be routed to the editor instead. For example, up and down might be used to traverse up and down a dropdown list where normally the grid would capture the keystrokes and move up or down a cell.
Sample code from my personal repo:
function SingleDropDownEditor(args) {
var $input = null;
var defaultValue;
var self = this;
var columnDataBundle = null;
self.keyCaptureList = [Slick.keyCode.UP, Slick.keyCode.DOWN, Slick.keyCode.ENTER];
self.OnIndexChangeEvent = function () {
$input.focus();
};
Yes, @6pac is absolutely right. All the key codes like
Slick.keyCode.UP, Slick.keyCode.DOWN, Slick.keyCode.ENTER
or
import { keyCode } from "slickgrid";
keyCode.UP, keyCode.DOWN, keyCode.ENTER
are numbers and checks like
if (this.currentEditor.keyCaptureList.indexOf(e.which) > -1)
will always return false and traversing up and down a dropdown list will be captured by default Slickgrid hotkeys listeners
@ghiscoding I've added the description.
thanks
The 'keyCaptureList' variable of the Editor class is an array of numbers.