按下特殊键时jqGrid多选行为 [英] jqGrid multiselect behavior when pressing special key

查看:86
本文介绍了按下特殊键时jqGrid多选行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只要没有按下特殊键,我期望多选择行为的行为就和正常情况一样.我的意思是,如果您选择了一行并在没有其他键按下的情况下单击了另一行,那么它应该选择新行并取消选择旧行.好的,jqGrid的标准选项可让您在始终正常的行为还是始终多重选择之间进行选择.仅当按下特殊键时,您才可以进行多项选择.

What I was expecting from a multiselect behaviour is to behave just as normal as long as no special key is pressed. I mean, if you have a row selected and click on another with no other key pressed, then it should select the new one and deselect the old row. Well, jqGrid’s standard options lets you choose between always regular behaviour, or always multiselect. You can’t have multiselect only when a special key is pressed.

有没有办法实现这一目标?

Is there a way I can achieve this?

推荐答案

jqGrid有几种选择策略,全部使用multiselect:true.为了演示该示例,我创建了三个示例:

jqGrid has several selection strategy, all using multiselect:true. To demonstrate there I created three example:

  1. 如果仅定义multiselect:true: http://www.ok- soft-gmbh.com/jqGrid/DataToMultiSelect2.htm .这是您不喜欢的标准行为.
  2. 如果另外定义multiboxonly:true: http://www.ok- soft-gmbh.com/jqGrid/DataToMultiSelect3.htm .在我看来,这种行为正是您所需要的.
  3. 如果另外定义multikey:"ctrlKey": http://www.ok- soft-gmbh.com/jqGrid/DataToMultiSelect4.htm .在这种情况下,仅在按下 Ctrl 的情况下才选择或取消选择该行.
  1. If you define only multiselect:true: http://www.ok-soft-gmbh.com/jqGrid/DataToMultiSelect2.htm. This is standard behavior which you not like.
  2. If you define additionally multiboxonly:true: http://www.ok-soft-gmbh.com/jqGrid/DataToMultiSelect3.htm. It seems to me that this behavior is what you need.
  3. If you define additionally multikey:"ctrlKey": http://www.ok-soft-gmbh.com/jqGrid/DataToMultiSelect4.htm. In the case the row will be selected or deselected only if Ctrl are pressed.

如果我正确理解了您的问题,则应该同时定义multiselect:truemultiboxonly:true,以接收您喜欢的行为.

If I understand your question correctly you should define both multiselect:true and multiboxonly:true to receive the behavior which you like.

如果我误解了您的问题,并且您想表达其他意思,请根据上述示例以其他方式进行描述.

If I misunderstood your question and you meaned something other please describe this in other words based on on of the above examples.

这篇关于按下特殊键时jqGrid多选行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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