在剑道网格中获取点击事件 [英] getting the click event in a kendo grid
问题描述
我试图获得Kendo Grid的点击事件,这样我就可以将东西绑定到shift和ctrl点击。我无法使用Kendo提供的固有多选,因为它不支持拖放操作。当我在dataBound事件后创建一个函数时,我的函数被点击时调用,但它不是典型的点击事件。
var onDataBound = function(){
selectItem.apply(this);
}
grid.dataBound = onDataBound;
var selectItem.apply = function(e){
console.log(e);
}
有什么想法?提前致谢。
在初始化 Grid
$ $ $ $ (click,table,function(e){
console.log(clicked,e.ctrlKey,e.altKey,e.shiftKey);
} );
您可以使用: 如果您只想检测点击您可以用 I'm trying to get the click event for a Kendo Grid so I can bind stuff to shift and ctrl clicking. I can't use the inherent multiselect Kendo provides because it doesn't support drag and drop. When I create a function after the dataBound event, my function gets called on clicking, but it's not the typical click event. Any thoughts? Thanks in advance. After initializing the Example: You can use: If you want to detect click only in the body of the table, you can replace 这篇关于在剑道网格中获取点击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
e.ctrlKey
用于检测是否按下 ctrl 。
e.altKey
用于检测是否按下 alt 。
e.shiftKey
用于检测是否按下 shift 。
tbody
甚至td替换
。table
var onDataBound = function () {
selectItem.apply(this);
}
grid.dataBound = onDataBound;
var selectItem.apply = function (e) {
console.log(e);
}
Grid
you should bind a handler to the click event.$("#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"
or even "td"
.