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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

how to disable a split button

Thread ID:

Created:

Updated:

Platform:

Replies:

115072 Dec 21,2013 05:49 AM UTC Jan 29,2014 11:42 AM UTC JavaScript 3
loading
Tags: General
charan
Asked On December 21, 2013 05:49 AM UTC

hi,
I am using split button.I have defined like

<button id="splitbuttonnormal">Save</button>

<ul id="menu1">

  <li id="1"><span>Open...</span></li>

  <li id="2"><span>Save</span></li>

  <li id="3"><span>Delete</span></li>

</ul>

I want to disable (li) item in the split button.how can I do that?


Soundara Pandian R [Syncfusion]
Replied On December 23, 2013 06:24 PM UTC

Hi Charan,

Thanks for your interest in Syncfusion products.

To disable the individual item in the split button’s menu, you can use the below code snippet:

[Script]

var menuObj = $("#menu1").data("ejMenu");

menuObj.disableMenuItembyID("2");

(or)

menuObj.disableMenuItem("Save");

Since split button uses the Menu control as sub control, we can use the functionalities of Menu control. For reference please refer the below link:

http://js.syncfusion.com/demos/#!/azure/menu/API's

Please let us know if you have any concerns.

Regards,

Soundara Pandian R


charan
Replied On January 27, 2014 08:11 AM UTC

hi,
I have implemented as above,but is is showing error that "ejmenu" not defined.and "menuObj" not defined.

Suganya M [Syncfusion]
Replied On January 29, 2014 11:42 AM UTC

Hi Charan,

Thanks for your update.

We would like to let you know that disabling or enabling menu items in the split button can be achieved by using the following menu control methods:

enableMenuItem();

disableMenuItem();

We have also prepared a sample for your reference. Please refer the attachment for sample.

Please get back to us if you need further assistance.

Regards,

Suganya M

SplitButton_5238c070.zip

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.

Warning Icon 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.Close Icon

;