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

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

问题描述

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

one question for all advanced in jqgrid.

我必须编写这个用例:

在 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

  • 如果实际单元格是最后一个,我设置下一个最近的可编辑单元格行或
  • 如果没有,我选择下一步实际行中的可编辑单元格.

总结一下——我需要像在 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.

非常感谢.

推荐答案

Ahoj!

要将可编辑单元格绑定到您的自定义事件处理程序,jqGrid 中有一些常见设置: editoptions.绝对 相同的设置存在于 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天全站免登陆