This is a migrated thread and some comments may be shown as answers.

Adding/Removing menu items client side

2 Answers 80 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Punit
Top achievements
Rank 1
Punit asked on 25 Nov 2008, 01:35 AM
Hi

I need to add or remove a menu item depending upon some comdiitons in javascript. I found no trouble finding menu object in javascript, I was able to remove an item as well with the help of 

menu._childListElement.removeChild(menu._childListElement.childNodes[4]);

but I could not find a way to add a menu item into it. There are functions like apendchild(child), but I am not able to figure out first how to create a child to pass that as parameter.

Is there a way to do add an item?

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Nov 2008, 04:48 AM
Hi Punit,

Please go through the below link which will help you to implement, adding and removing menu items on client side.

Add / Remove / Disable Menu Items

Thanks,
Shinu.
0
Punit
Top achievements
Rank 1
answered on 25 Nov 2008, 07:27 PM
Thanks

I got the solution in items collection api.

 

var childItem = new Telerik.Web.UI.RadMenuItem();

 

childItem.set_text(strOption);

childItem._click = AdjustOwner_LoadDropdown;

menu.get_items().insert(2, childItem);

 

Tags
Menu
Asked by
Punit
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Punit
Top achievements
Rank 1
Share this question
or