单元格编辑中类似Excel的Enter和Tab键导航 [英] Excel-like enter and tab key navigation in cell editing

查看:97
本文介绍了单元格编辑中类似Excel的Enter和Tab键导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jqgrid中所有高级的一个问题.

one question for all advanced in jqgrid.

我必须对此用例进行编码:

i have to code this usecase:

在jqGrid中有两个可编辑的列.我必须使用单元格编辑. 用户单击到一个可编辑单元格,然后按" Enter "键,则在实际的单元格下选择下一个可编辑单元格.

In jqGrid there are two editable columns. I have to use cell editing. User click to one editable cell and when he presses 'Enter' key, i select next editable cell UNDER actual one.

否则,当他按下" tab "键时,我选择下一个可编辑的单元格

Otherwise, when he hits 'tab' key, i select next editable cell

  • 如果实际单元格是最后一个单元格,则将 下一个最近的可编辑单元格 行或
  • 如果没有,我选择下一个 实际行中的可编辑单元格.
  • if actual cell is last, i set the nearest editable cell in the next line or
  • if not, i select next editable cell in the actual row.

总结–我需要像excel一样的准确行为.

to sum up – i need exact behaviour like in excel.

如果我有更好的声誉,我本可以上传一张图像来展示期望的情况.

if i had better reputation, I could have uploaded an image to demonstrate desired situation.

非常感谢.

推荐答案

哎呀!

要将可编辑单元格绑定到自定义事件处理程序,请在jqGrid中进行以下常规设置:dataEvents属性#editoptions"rel =" nofollow noreferrer>编辑选项.绝对在jqGrid中存在相同的设置 .您可以在此处找到一些代码示例, 此处此处.您可能需要在内部使用单元格编辑方法键盘事件处理程序的功能,可以结束一个单元格的编辑并开始编辑另一个单元格.

To bind editable cell to your custom event handler there are common setting in jqGrid: dataEvents property of editoptions. Absolutely the same settings exist for the searching in jqGrid. You can find some code examples here, here and here. You will probably needed to use cell editing methods inside of the keyboard event handler to be able to end editing of one cell and to start editing of another one.

如果您在实现中遇到问题,可以在代码示例后附加问题,然后尝试修改它.

If you will have problem in the implementation you can append your question with the code example and then one can try to modify it.

这篇关于单元格编辑中类似Excel的Enter和Tab键导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆