Hello,
I need to make my own helper of panel bar to manage conditional displaying of items.
I made it like this
But how can I link items to the PanelBarBuilder ?
With this instructions : myPanel.ItemAction(ac => ac.Items.Add(itAction));
Method only returns javascript.
thanks for your help
I need to make my own helper of panel bar to manage conditional displaying of items.
I made it like this
public static Kendo.Mvc.UI.Fluent.PanelBarBuilder MovementPanel(this HtmlHelper helper, string name, Boolean withContainer,string Controller, RouteValueDictionary export)
{
Kendo.Mvc.UI.Fluent.PanelBarBuilder myPanel = helper.Kendo().PanelBar()
.Name(name)
.ExpandAll(true)
.ExpandMode(PanelBarExpandMode.Multiple);
PanelBarItem itAction = new PanelBarItem();
itAction.Text = "Actions";
itAction.Items.Add(NewBarItem("Error detail","javascript:void(0)"));
itAction.Items.Add(NewBarItem("File content", "javascript:void(0)"));
PanelBarItem itExcel = new PanelBarItem();
itExcel.Text = "Excel export";
itExcel.Action("ExportToExcel", Controller, export);
itAction.Items.Add(itExcel);
if (withContainer)
{
itAction.Items.Add(NewBarItem("Container history", "javascript:void(0)"));
}
myPanel.ItemAction(ac => ac.Items.Add(itAction));
myPanel.Events(events =>
events.Select("OnSelectAction")
);
return myPanel;
}
private static PanelBarItem NewBarItem(string text, string url)
{
PanelBarItem itTemp = new PanelBarItem();
itTemp.Text = text;
itTemp.Url = url;
return itTemp;
}
But how can I link items to the PanelBarBuilder ?
With this instructions : myPanel.ItemAction(ac => ac.Items.Add(itAction));
Method only returns javascript.
thanks for your help