我正在尝试获取 Kendo Grid 的单击事件,以便我可以将内容绑定到 Shift 和 Ctrl 单击。我无法使用 Kendo 提供的固有多选功能,因为它不支持拖放。当我在 dataBound 事件之后创建函数时,我的函数会在单击时被调用,但这不是典型的单击事件。
var onDataBound = function () {
selectItem.apply(this);
}
grid.dataBound = onDataBound;
var selectItem.apply = function (e) {
console.log(e);
}
有什么想法吗?提前致谢。
初始化后Grid
您应该将处理程序绑定到单击事件。
Example:
$("#grid").on("click", "table", function(e) {
console.log("clicked", e.ctrlKey, e.altKey, e.shiftKey);
});
您可以使用:
-
e.ctrlKey
for detecting if ctrl is pressed.
-
e.altKey
for detecting if alt is pressed.
-
e.shiftKey
for detecting if shift is pressed.
如果您只想检测表格正文中的点击,您可以替换"table"
by "tbody"
甚至"td"
.
Jsfiddle示例 http://jsfiddle.net/OnaBai/PgeYC/.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)