防止行双待可编辑 - jqGrid [英] Prevent row becoming editable during double click - jqGrid

查看:140
本文介绍了防止行双待可编辑 - jqGrid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们是一个Struts2-jQuery Grid实现,它类似于jqGrid。我们已经将我们的网格作为

  multiselect =true和editinline =true

我们在每行的数据中添加了自定义编辑按钮,并希望该行只能通过该按钮进行编辑。我们已经删除了编辑的导航栏/工具栏图标。



目前,即使在双击该行时,数据行也可以编辑。我们能捕捉到这个事件,但是如何取消这个动作呢?我们尝试返回假,停止..但他们没有工作。我们甚至尝试停止执行,仍然可以编辑这行。



我们该如何阻止?

解决方案

将其添加到您的jqgrid以及其他参数



  ondblClickRow:function(){
return false;
},



或使用jquery u可以绑定双击事件(ondblClickRow)到你的网格,并从该函数返回false。


Ours is a Struts2-jQuery Grid implementation , it is similar to jqGrid. We have made our Grid as

multiselect="true" and editinline="true"

We have added 'Custom Edit' buttons in each row's data and want the row to become editable only via that. We have removed the navbar/tool bar icons for 'Edit'.

Currently, the data row becomes editable even during a double click on the row. We are able to capture the event, but how to cancel out the action ? we tried returning false, stop.. but they did not work. We even tried stop.propogation and still the row was becoming editable.

How can we stop this ?

解决方案

add this to your jqgrid along with other parameters

ondblClickRow: function(){
  return false ;
},

OR using jquery u can bind double click event (ondblClickRow) to you grid and return false from that function.

这篇关于防止行双待可编辑 - jqGrid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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