我想在checkbox
添加Toolbar of a Kendo Grid
,但文档中没有配置或示例。那么,是否可以添加checkbox
作为按钮?
<script>
var grid = $("#grid").kendoGrid({
toolbar: [
{ name: 'excel', text: 'Export to Excel' },
{ type: 'checkbox', text: 'Get full list', id: "cbFull" } //it does not work
]
//code omitted for brevity
<script>
答案 0 :(得分:1)
<script type="text/x-kendo-template" id="template">
<div class="toolbar">
<input type="button" id="exportExcel" value="Export Excel"/>
<label class="list-label" for="list">Get full list:</label>
<input type="checkbox" id="list" style="width: 75px"/>
</div>
</script>
<script>
$(document).ready(function() {
var grid = $("#grid").kendoGrid({
toolbar: kendo.template($("#template").html())
//code omitted for brevity
var excelButton = grid.find("#exportExcel")
excelButton.on("click",function(){
alert("Saving...");
grid.data("kendoGrid").saveAsExcel();
});
});
</script>
示例http://dojo.telerik.com/iFodO(导出实际上不像缺少的JSZip那样工作)