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();
}