• append (item, referenceItem) : Menu
    Appends an item to a Menu in the specified referenceItem's sub menu.

    Example

    // get a reference to the menu widget
    var menu = $("#menu").data("kendoMenu");
    //
    menu.append(
        [{
            text: "Item 1",
            url: "http://www.kendoui.com"                // Link URL if navigation is needed, optional.
        },
        {
            text: "<b>Item 2</b>",
            encoded: false,                                 // Allows use of HTML for item text
            content: "text"                                 // content within an item
        },
        {
            text: "Item 3",
            imageUrl: "http://www.kendoui.com/test.jpg", // Item image URL, optional.
            items: [{                                    // Sub item collection
                 text: "Sub Item 1"
            },
            {
                 text: "Sub Item 2"
            }]
        },
        {
            text: "Item 4",
            spriteCssClass: "imageClass3"                // Item image sprite CSS class, optional.
        }],
        referenceItem
    );

    Parameters

    item: Selector
    Target item, specified as a JSON object. Can also handle an array of such objects.
    referenceItem: Item
    A reference item to append the new item in.
    Returns
    Menu Returns the Menu object to support chaining.
  • close (element) : Menu
    Closes a sub-menu of a specified item(s) in a Menu.

    Example

    // get a reference to the menu widget
    var menu = $("#menu").data("kendoMenu");
    // close the sub menu of "Item1"
    menu.close("#Item1");

    Parameters

    element: Selector
    Target item selector.
    Returns
    Menu Returns the Menu object to support chaining.
  • enable (element, enable) : Menu
    Enables or disables an item of a Menu. This can optionally be accomplished on initialization by setting the disabled="disabled" on the desired menu item html element.

    Example

    // get a reference to the menu widget
    var menu = $("#menu").data("kendoMenu");
    // disable the li menu item with the id "secondItem"
    menu.enable("#secondItem", false);

    Parameters

    element: Selector
    Target element
    enable: Boolean
    Desired state
    Returns
    Menu Returns the Menu object to support chaining.
  • insertAfter (item, referenceItem) : Menu
    Inserts an item into a Menu after the specified referenceItem.

    Example

    // get a reference to the menu widget
    var menu = $("#menu").data("kendoMenu");
    //
    menu.insertAfter(
        [{
            text: "Item 1",
            url: "http://www.kendoui.com"                // Link URL if navigation is needed, optional.
        },
        {
            text: "<b>Item 2</b>",
            encoded: false,                                 // Allows use of HTML for item text
            content: "text"                                 // content within an item
        },
        {
            text: "Item 3",
            imageUrl: "http://www.kendoui.com/test.jpg", // Item image URL, optional.
            items: [{                                    // Sub item collection
                 text: "Sub Item 1"
            },
            {
                 text: "Sub Item 2"
            }]
        },
        {
            text: "Item 4",
            spriteCssClass: "imageClass3"                // Item image sprite CSS class, optional.
        }],
        referenceItem
    );

    Parameters

    item: Selector
    Target item, specified as a JSON object. Can also handle an array of such objects.
    referenceItem: Selector
    A reference item to insert the new item after.
    Returns
    Menu Returns the Menu object to support chaining.
  • insertBefore (item, referenceItem) : Menu
    Inserts an item into a Menu before the specified referenceItem.

    Example

    // get a reference to the menu widget
    var menu = $("#menu").data("kendoMenu");
    //
    menu.insertBefore(
        [{
            text: "Item 1",
            url: "http://www.kendoui.com"                // Link URL if navigation is needed, optional.
        },
        {
            text: "<b>Item 2</b>",
            encoded: false,                                 // Allows use of HTML for item text
            content: "text"                                 // content within an item
        },
        {
            text: "Item 3",
            imageUrl: "http://www.kendoui.com/test.jpg", // Item image URL, optional.
            items: [{                                    // Sub item collection
                 text: "Sub Item 1"
            },
            {
                 text: "Sub Item 2"
            }]
        },
        {
            text: "Item 4",
            spriteCssClass: "imageClass3"                // Item image sprite CSS class, optional.
        }],
        referenceItem
    );

    Parameters

    item: Selector
    Target item, specified as a JSON object. Can also handle an array of such objects.
    referenceItem: Selector
    A reference item to insert the new item before
    Returns
    Menu Returns the Menu object to support chaining.
  • open (element) : Menu
    Opens a sub-menu of a specified item(s) in a Menu.

    Example

    // get a reference to the menu widget
    var menu = $("#menu").data("kendoMenu");
    // open the sub menu of "Item1"
    menu.open("#Item1");

    Parameters

    element: Selector
    Target item selector.
    Returns
    Menu Returns the Menu object to support chaining.
  • remove (element) : Menu
    Removes a specified item(s) from a Menu.

    Example

    // get a reference to the menu widget
    var menu = $("#menu").data("kendoMenu");
    // remove the item with the id "Item1"
    menu.remove("#Item1");

    Parameters

    element: Selector
    Target item selector.
    Returns
    Menu Returns the Menu object to support chaining.