1
我有一些舊的代碼定義在這樣的網格中的工具欄:是否可以在Kendo Grid中組合不同類型的工具欄定義?
@(Html.Kendo().Grid<Object>().Name("SomeGrid")
.ToolBar(toolBar => toolBar.Custom()
.Text("<i class='icon-download'></i> Exportieren")
.HtmlAttributes(new { id = "export" })
.Url(Url.Action("Export", "ControllerName", new { page = 1, pageSize = "~", filter = "~", sort = "~", ElementId= ViewBag.CurrKompfGrp }))
)
...
我想添加更多的按鈕進去。 我發現,在其他網格使用至今最好的辦法是用.Template功能:
.ToolBar(toolbar =>
{
toolbar.Template("<a class='btn' id='panelAddAktionButton' onclick='aktionen.addItem();'><i class='icon-plus' rel='tooltip' title='add action'></i> </a> " +
"<a class='btn' id='panelEditAktionButton' onclick='aktionen.editItem();'><i class='icon-edit' rel='tooltip' title='Edit action'></i> </a> ");
})
然而,問題是,我不知道怎樣才能輕鬆地將一個方法到另一個。 當我嘗試在方法編號1中添加幾個項目時,Visual Studio強調它是一個錯誤。 而且由於第一種方法中的url是動態的,因此將其轉換爲第二種方法存在問題。
我也嘗試將兩個結合起來 - 但又得到了錯誤。
任何想法感謝!