将KENDOUI工具栏与网格工具栏集成在一起 [英] integrating KENDOUI toolbar with grid toolbar
问题描述
我想将KENDOUI工具栏工具栏与KENDOUI的基本CRUD工具栏操作网格网格。
我想在我的基本工具栏(第一个链接)中添加一个按钮'create',它在我的网格中添加了新的一行(第二个链接)。 解决方案
我不认为你可以将Kendo ToolBar小部件与内置的网格工具栏结合起来,但是你可以使用一个可以是Kendo ToolBar的模板来完全定义网格的工具栏您完全可以控制。
http: //dojo.telerik.com/@Stephen/OJAbI
在这个例子中,我已经参加了2个演示,并且从ToolBar添加了ToolBar演示,并使用toolbar.template配置将其添加为Grid的工具栏:
工具栏:[
{
template:'< div id =toolbar>< / div>'
}],
然后,toolbar元素被转换为完整的工具栏,其中包含 工具栏)。kendoToolBar({...} );
$ p $ $(#b
其中我添加了添加新记录按钮,ToolBar的单击处理程序为
click:function(e){
$(#grid)。getKendoGrid()。addRow();
}
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).
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();
}
这篇关于将KENDOUI工具栏与网格工具栏集成在一起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!