Customize the Drop-Down Menu

On desktops and iOS devices, the drop-down menu is the Popover widget; on other devices, it is the Popup widget. To use the Popup on all devices, assign false to the usePopover option. In this case, you can specify whether to shade the area beneath the Popup and whether the Popup should occupy the full screen.

JavaScript
$(function() {
    $("#lookupContainer").dxLookup({
        dataSource: [
            "HD Video Player",
            "SuperHD Video Player",
            "SuperPlasma 50",
            // . . .
        ],
        usePopover: false,
        shading: false,
        fullScreen: false
    });
});

To change the size of the drop-down menu and position it against a specific element on your page, specify the popupHeight, popupWidth and position options, respectively. The following configuration of the position option reads as follows: "place my left side at the left side of the "#targetElement".

JavaScript
$(function() {
    $("#lookupContainer").dxLookup({
        dataSource: [
            "HD Video Player",
            "SuperHD Video Player",
            "SuperPlasma 50",
            // . . .
        ],
        popupHeight: 300,
        popupWidth: 300,
        position: {
            my: "left",
            at: "left",
            of: "#targetElement"
        }
    });
});

The drop-down menu can have a title. Use the title option to specify its text, or the titleTemplate option to redesign it completely. For details on implementing templates, see the Customize Item Appearance topic.

JavaScript
$(function() {
    $("#lookupContainer").dxLookup({
        dataSource: [
            "HD Video Player",
            "SuperHD Video Player",
            "SuperPlasma 50",
            // . . .
        ],
        title: "Products"
        /*
        titleTemplate: function () {
            return $("<div style='color: blue'>Products</div>");
        }
        */
    });
});

If you have not specified anything to be displayed in the title, hide it by assigning false to the showPopupTitle option.

See Also