如何向单击时不选择该行的jqGrid行添加自定义按钮 [英] How to add a custom button to a jqGrid row that does NOT select the row when clicked

查看:88
本文介绍了如何向单击时不选择该行的jqGrid行添加自定义按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个来自Oleg的示例与我要查找的行为非常接近(第一个按钮),但我想保留是否将其突出显示(如果可能的话),并且不想突出显示一行并检查检查框(如果未选中).为了澄清,如果他们单击此按钮,我将弹出一个模式对话框,这与编辑行无关.

This example from Oleg is very close to the behavior I'm looking for (the first button) but I want preserve whether or not it was highlighted if possible, and don't want to highlight a row and check on the check box if it was un-selected. Just to clarify, I will be popping a modal dialog if they click this button, it has nothing to do with editing the row.

http://www.ok-soft-gmbh.com/jqGrid/Admin3.htm

谢谢你, 斯蒂芬

推荐答案

要防止突出显示将单击自定义按钮的行,只需在click事件处理程序内添加return false;即可:

To prevent highlighting of the row in which the custom button will be clicked one need just include return false; inside of click event handler:

click: function(e) {
    alert("'Custom' button is clicked in the rowis="+
        $(e.target).closest("tr.jqgrow").attr("id") +" !");
    return false; // !!!!!
}

演示演示了结果.它是答案答案中的代码更新了myDelOptions.onclickSubmit的代码.

The demo demonstrate the results. It's the updated version of the demo from the answer and the previous one which you referenced in your question. Additionally I updated the code of myDelOptions.onclickSubmit based on the code from the answer.

这篇关于如何向单击时不选择该行的jqGrid行添加自定义按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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