I want to create a custom toolbar. Here is my code:
toolbar:[{
text: "Go to Add User Page",
className: "k-grid-custom",
imageClass: "k-add"
}],
function createUser(){
alert('Hello World');
}
I want to call the function named createUser when this button(custom toolbar) is clicked. How to make it possible?
You could add a unique class to the button and then use that class to bind to the click event.
toolbar:[{
text: "Go to Add User Page",
className: "myCustomClass",
imageClass: "k-add"
}],
$(".myCustomClass").click(function() {
alert("Click!");
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With