Adding/Removing menu items client side

3 posts, 0 answers
  1. Punit
    Punit avatar
    12 posts
    Member since:
    Sep 2008

    Posted 24 Nov 2008 Link to this post

    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. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 24 Nov 2008 Link to this post

    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.
  3. Punit
    Punit avatar
    12 posts
    Member since:
    Sep 2008

    Posted 25 Nov 2008 Link to this post

    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);

     

Back to Top