Javascript 无法在ng网格中的行中的编辑字段内移动光标

Javascript 无法在ng网格中的行中的编辑字段内移动光标,javascript,angularjs,html,ng-grid,Javascript,Angularjs,Html,Ng Grid,我使用的是nggrid 2.x版本,我想将光标移动到行中的文本字段中,但箭头键对编辑字段没有影响。尝试添加FLOWING grid选项 索引:0, noTabInterference:true您能否添加有关您提供的解决方案的更多详细信息?感谢您回答此问题。请考虑添加一个简短的解释,说明您的代码如何解决这个问题。 onKeyDown = (event): void => { const { keyCode, target, shiftKey } = event; if (s

我使用的是nggrid 2.x版本,我想将光标移动到行中的文本字段中,但箭头键对编辑字段没有影响。

尝试添加FLOWING grid选项 索引:0,
noTabInterference:true

您能否添加有关您提供的解决方案的更多详细信息?感谢您回答此问题。请考虑添加一个简短的解释,说明您的代码如何解决这个问题。
 onKeyDown = (event): void => {
    const { keyCode, target, shiftKey } = event;
    if (shiftKey) {
      if (keyCode === 37) {
        const { selectionStart } = target;
        if (selectionStart !== null && selectionStart) {
          target.selectionStart = selectionStart - 1;
        }
      } else if (keyCode === 39) {
        const { selectionEnd } = target;
        if (selectionEnd !== null) {
          target.selectionEnd = selectionEnd + 1;
        }
      }
    } else if (keyCode === 37) {
      const selection = target.selectionStart;
      if (selection !== null && selection) {
        target.selectionStart = selection - 1;
        target.selectionEnd = selection - 1;
      }
    } else if (keyCode === 39) {
      const selection = target.selectionStart;
      if (selection !== null) {
        target.selectionStart = selection + 1;
        target.selectionEnd = selection + 1;
      }
    } else if (keyCode === 35) {
      target.selectionStart = get(target, 'value.length', 0);
      target.selectionEnd = get(target, 'value.length', 0);
    } else if (keyCode === 36) {
      target.selectionStart = 0;
      target.selectionEnd = 0;
    }
  };