getting the click event in a kendo grid

Crystal

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.

var onDataBound = function () {
    selectItem.apply(this);
}

grid.dataBound = onDataBound;

var selectItem.apply = function (e) {
    console.log(e);
}

Any thoughts? Thanks in advance.

OnaBai

After initializing the Grid you should bind a handler to the click event.

Example:

$("#grid").on("click", "table", function(e) {
    console.log("clicked", e.ctrlKey, e.altKey, e.shiftKey);
});

You can use:

  • e.ctrlKey for detecting if ctrl is pressed.
  • e.altKey for detecting if alt is pressed.
  • e.shiftKey for detecting if shift is pressed.

If you want to detect click only in the body of the table, you can replace "table" by "tbody" or even "td".

Jsfiddle example.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Jquery Click Event not does works on Kendo Grid

From Dev

how to get cell click event in kendo grid

From Dev

Getting Kendo Grid Name in an Event Handler

From Dev

Kendo Grid keydown event

From Dev

Kendo Grid keydown event

From Dev

Kendo grid button click arguments

From Dev

Unbind Kendo UI Grid Event

From Dev

Kendo UI Grid on Cancel event

From Dev

Kendo Grid: Onchange event is not triggering

From Dev

Kendo grid event handling after grid initalisation

From Dev

Kendo UI Button - on click event

From Dev

Kendo UI Button - on click event

From Dev

Not getting click event in jQuery

From Dev

Cannot refresh kendo grid on button click in angularjs

From Dev

Kendo Grid: Saving State in columnReorder event

From Dev

Is there an event indicating that a Kendo Grid has been rendered?

From Dev

Selecting the kendo grid row on DetailExpand event

From Dev

kendo ui grid background change event

From Dev

MVC Kendo Grid multiple functions for DataBound event

From Dev

Kendo Grid Is there an event for when a row changes (not selected)?

From Dev

knockout-kendo.js grid databound event

From Dev

How to undo preventdefault in save event in Kendo Grid

From Dev

Event called when sorting data in kendo grid

From Dev

kendo ui grid background change event

From Dev

Kendo Grid column resize end event

From Dev

MVC Kendo Grid multiple functions for DataBound event

From Dev

Kendo Grid Is there an event for when a row changes (not selected)?

From Dev

which is the last event in Kendo grid after databound

From Dev

Alternative to detailinit event in Angular 2 Kendo grid