I am working on ASP.NET MVC4 application.In which i am using Kendo UI controls.
I am using Kendo Grid.And i want to add event listener on Kendo Grid Toolbar's "add new item" button.
Below is the piece of the code of Grid command button:
.ToolBar(commands =>
{
commands.Create();
commands.Save();
})
And i want to overrides its click event.Actually i want to check some condition on its click event.And if condition returns true then i want this button should enable otherwise it should be disable.
I have tried to overrides it by some of the below codes but its not worked.
Example:
1) '$(".k-button.k-button-icontext.k-grid-add").bind("click", function () {
alert('add link event');
});
2) $(".k-grid-Add").on('click',function () {
alert("Hello");
});
3) $(".k-button.k-button-icontext.k-grid-add").on("click", function () {
alert('add link event');
}); '
But none of above are working.
Can anyone suggest me the way for this?
Thanks