integrating KENDOUI toolbar with grid toolbar

三世轮回 提交于 2019-12-13 08:28:45

问题


i want to integrate KENDOUI toolbar toolbar with basic CRUD toolbar operation of KENDOUI grid grid. I want to have button 'create' in my basic toolbar (first link) that adds new line in my grid(second link).


回答1:


I don't think you can combine the Kendo ToolBar widget with the built-in grid toolbar but you can completely define the grid's toolbar using a template which can be a Kendo ToolBar that you have complete control over.

http://dojo.telerik.com/@Stephen/OJAbI

In this example I have taken the 2 demos you linked to and added the ToolBar from the ToolBar demo and added it as the toolbar for the Grid using the toolbar.template configuration:

toolbar: [
{
    template: '<div id="toolbar"></div>'
}],

Then, the "toolbar" element gets converted to a full ToolBar with

$("#toolbar").kendoToolBar({...});

in which I have added a "Add new record" button and the click handler of the ToolBar is

click: function(e) {
    $("#grid").getKendoGrid().addRow();
}


来源:https://stackoverflow.com/questions/38121717/integrating-kendoui-toolbar-with-grid-toolbar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!