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.
Unfortunately, activation email could not send to your email. Please try again.

Disabling menuitems server-side

Thread ID:

Created:

Updated:

Platform:

Replies:

102278 Jan 17,2012 06:21 AM Mar 24,2018 01:06 AM ASP.NET MVC (Classic) 8
loading
Tags: Tools
Mark Treveil
Asked On January 17, 2012 06:21 AM

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


Varalakshmi R.S [Syncfusion]
Replied On January 18, 2012 01:26 AM

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



Mark Treveil
Replied On January 18, 2012 04:19 AM

Thanks.

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

Mark


Varalakshmi R.S [Syncfusion]
Replied On January 18, 2012 04:34 AM

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



Mark Treveil
Replied On January 18, 2012 05:08 AM

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


Varalakshmi R.S [Syncfusion]
Replied On January 19, 2012 01:26 AM

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




Mark Treveil
Replied On January 19, 2012 04:53 AM

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

Mark


Varalakshmi R.S [Syncfusion]
Replied On January 19, 2012 06:54 AM

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



Adam K
Replied On March 24, 2018 01:06 AM

Thanks.

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

Mark


I agree

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;