integrating KENDOUI toolbar with grid toolbar

2019-09-19 14:23发布

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条回答
仙女界的扛把子
2楼-- · 2019-09-19 15:07

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();
}
查看更多
登录 后发表回答