Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

preventDefault() does not work in Kendo grid's custom click handler

I've added the custom click handler for Kendo grid's "Add new record" button, but JavaScript's preventDefault() function does not seem to work on it.

$('.k-header').on('click', '.k-grid-add', function(e) {
    e.preventDefault();
    e.stopPropagation();
    // do something else
});

I would like that "Add new record" button does something else than adds the new row in grid.

Full code example: JSFIDDLE

like image 918
CuriousSuperhero Avatar asked Nov 07 '14 08:11

CuriousSuperhero


1 Answers

This works

$('.k-grid-add').click(function(e) {
    // do something else
    return false;
});
like image 145
BenG Avatar answered Nov 03 '22 00:11

BenG