将自定义按钮添加到KendoGrid工具栏问题 [英] Adding custom button to KendoGrid Toolbar Issue
本文介绍了将自定义按钮添加到KendoGrid工具栏问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,我在KendoUI Grid的工具栏上添加了一个按钮,但是我有几个问题,希望有人可以提供帮助.
Hi I've added a button to the toolbar of my KendoUI Grid, but I have a couple of issues, I'm hoping someone can assist with.
- 我尝试在按钮旁边添加一个kendo Web图标,但它不会呈现.
- 单击工具栏上的按钮时,我在控制台中看到以下错误:
未捕获的ReferenceError:未定义sendEmail.
Uncaught ReferenceError: sendEmail is not defined.
我不明白为什么它没有看到我的功能.出于测试目的,我一直显示警报,直到看到警报为止.
I don't understand why it isn't seeing my function. Just for testing purposes I'm displaying an alert until it sees it.
toolbar: [
{ name: "create", text: "Add" },
{ template: "<input type='button' class='k-button' value='Email Users' onclick='sendEmail()' />",
imageclass: "k-icon k-i-pencil" }
]
function sendEmail() {
debugger;
alert('Send Emails');
}
有人可以帮忙吗?
推荐答案
您可以按以下方式使用:
You can Use as below:
toolbar: [
{
name: "Add",
text: "Send Email",
click: function(e){alert('Send Emails'); return false;}
}
],
这篇关于将自定义按钮添加到KendoGrid工具栏问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文