redrom
redrom

Reputation: 11632

Kendo Grid -> How to trigger custom method on Add click button

I'm trying to catch click on the "Add new record" button in Kendo Data Grid. I tried to find this in documentation but without luck (I found how to catch click on detail button).

How can i do it please?

I don't want to trigger adding new row but i want to redirect user on new page.

Thanks for any advice.

enter image description here

Upvotes: 1

Views: 2857

Answers (2)

Jaimin
Jaimin

Reputation: 8020

try like this,

$('.k-grid-add').on('click',function(){
    alert('Hi');
});

Upvotes: 0

CuriousSuperhero
CuriousSuperhero

Reputation: 6671

You can catch the click on the "Add new record" button using the following code.

$('.k-header').on('click', '.k-grid-add', function() {
     alert("Forward to Stackoverflow");
     window.location.replace("http://stackoverflow.com");
});

Upvotes: 4

Related Questions