We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Disabling menuitems server-side

Guys,

I cannot see a way to create MenuItem objects flagged as disabled. The only support seems to be client-side.

There are many situations, such as a multi-role applications, where you want menu items to be disabled by default.

I am using 9.3.0.61 currently, and trying to create menus as per the 'Through Model' sample.

Mark


8 Replies

VR Varalakshmi R.S Syncfusion Team January 18, 2012 06:26 AM UTC

Hi Mark,

Thanks for contacting Syncfusion forum.

We regret to let you know that currently we do not provide support for disabling the menu items through server side but particular items can be disabled by default in the $(document).ready(function(){}); method by using DisableMenuItem method.
Kindly refer the following UG online links for getting details on these methods,
http://help.syncfusion.com/ug_94/User%20Interface/ASP.NET%20MVC/Tools/Documents/51038clientsidemetho.htm

Regards,
Varalakshmi




MT Mark Treveil January 18, 2012 09:19 AM UTC

Thanks.

It is something I would love to see in the future, maybe it can be put on the development list.

Mark



VR Varalakshmi R.S Syncfusion Team January 18, 2012 09:34 AM UTC

Hi Mark,

Thanks for your comments.

We have forwarded this to our development team for more analysis on implementing this feature. We will implement this feature in our forthcoming new version releases or service pack releases. We usually have an interval of at least three months between releases. The feature implementation would also greatly depend on the factors such as product design, code compatibility and complexity. We will get back to you once the feature is implemented.

Regards,
Varalakshmi




MT Mark Treveil January 18, 2012 10:08 AM UTC

Thanks.

The other thing that seems to be missing from the ThroughModel approach to building menus is the ability to add separators? Is that something you can do with a MenuItem object (e.g. setting the text to a hyphen), or just not supported.

I have to say, it looks easier to generator the ul /li structure from my own code and render this on the view, rather than use the Syncfusion objects in ThroughModel mode, which seem incomplete and generally clunky.

Mark



VR Varalakshmi R.S Syncfusion Team January 19, 2012 06:26 AM UTC

Hi Mark,

Thanks for the update.

Yes, separators or setting the text to a hyphen can also be done in the MenuItem. Create a MenuItem for separators and add that to the MenuItems list to show the separators in Menu. Please refer the below code snippet to achieve this,


[Through Model]
MenuItem newdoc = new MenuItem() { Text = "New" };
MenuItem open = new MenuItem() { Text = "Open" };
MenuItem save = new MenuItem() { Text = "Save" };
//file
List File = new List() { newdoc, open, save };
MenuItem filebase = new MenuItem() { Text = "File", Children = File };

//separator
MenuItem sep = new MenuItem() { Text = "|" };

//submenu of edit
MenuItem undo = new MenuItem() { Text = "Undo" };
MenuItem redo = new MenuItem() { Text = "Redo" };
//edit
List Edit = new List() { undo, redo, cut, copy, paste };
MenuItem editbase = new MenuItem() { Text = "Edit", Children = Edit };

menuItems.Items = new List() { filebase, sep, editbase };



Kindly refer the above code snippet and let us know if it helps.

Regards,
Varalakshmi





MT Mark Treveil January 19, 2012 09:53 AM UTC

Cheers. It would good to get that including in the online ThroughModel sample.

Mark



VR Varalakshmi R.S Syncfusion Team January 19, 2012 11:54 AM UTC

Hi Mark,

Thanks for sharing the details.

We will forward your request to our development team for updating the online samples. Since, the code freeze done for volume 1,2012 these changes will not be available in vol1,2012 release.

Regards,
Varalakshmi




AK Adam K replied to Mark Treveil March 24, 2018 05:06 AM UTC

Thanks.

It is something I would love to see in the future, maybe it can be put on the development list.

Mark


I agree

Loader.
Live Chat Icon For mobile
Up arrow icon