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

how to disable a split button

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?


3 Replies

SP Soundara Pandian R Syncfusion Team 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



CH charan 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.


SM Suganya M Syncfusion Team 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

Loader.
Up arrow icon