问题描述
每个jQgrid行都有多个复选框,因此我不能使用(仅)多重选择.
Each jQgrid row has multiple checkboxes, so I cannot use (just) the multiselect.
这是设置列的方式...
This is how the column is setup...
当我单击标题中的复选框时,将重新绘制标题,而不会选中该复选框.我可以捕获事件,但是无法向用户显示支票.
When I click the checkbox in the header, the header is redrawn without the check. I can capture the event, but cannot display the check to the user.
所以我的问题是,如何获得一个在标题标签中正常运行的复选框,或者如何实现多个多重选择.
So my question would be, how can I get a checkbox to operate normally inside a header label OR how can I implement multiple multiselects.
推荐答案
我能够通过防止在复选框事件之后触发jQgrid事件来解决问题.
I was able to fix my problem by preventing the jQgrid events from firing after the checkbox event.
我将复选框更改为...
I changed my checkbox to...
<input type="checkbox" onclick="checkBox(event)" />
并添加了以下方法...
and added the following method...
function checkBox(e) {
e = e||event;/* get IE event ( not passed ) */
e.stopPropagation? e.stopPropagation() : e.cancelBubble = true;
}
这篇关于如何在jQgrid标头中添加复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!