Hi,
I'd like to add a menu control to my web app, but I noticed that the sidebar demo uses a listview for a menu as opposed to the menu control. I am not an expert in layout and control use so it is not obvious to me why this is done (it may be standard practice for all I know or maybe the menu control doesn't work in a sidebar!).
Should I be using a listview or a menu in a sidebar menu?
If menu is ok, are there are pros/cons of using it versus the listview (in a menu scenario)?
And finally, (if menu is ok) is it easy to add a menu control to a sidebar or is there a sample somewhere (I did have a quick look but couldn't find anything)?
Thanks in advance
Hi Deepa,
Many thanks for this, the sample especially is very useful!
It looks as though the listview with nesting achieves the same thing as the menu with sub-options so I guess there isn't really much of a difference in functionality in a menu scenario. It will probably come down to which looks better for me!
Thanks
Dan
Hi Deepa,
I have another question (on the listview this time) - how do you make each item of the listview a hyperlink/url?
I have read through the help section on this (https://ej2.syncfusion.com/aspnetcore/documentation/listview/how-to/#listview-with-hyper-link-navigation) and I understand about adding the url to the listdata viewbag, but I don't understand what to do with the achor_template (var anchor_template = "<a target='_blank' rel='nofollow' href='${url}'>${name}</a>";) to make it apply to the listview items.
Thanks
var anchor_template = "<a target='_blank' rel='nofollow' rel='nofollow' href='${url}'>${name}</a>";
|
List<object> listdata = new List<object>();
listdata.Add(new { name = "Google", url = "https://www.google.com" });
|
Thanks Deepa, yes it was this bit in the view I was missing:-
template="@anchor_template"
Now I have seen this I understand how it is all wired together, many thanks :)