UI Widgets Popover

A widget that displays the required content in a popup window.

Included in: dx.phonejs.js, dx.webappjs.js, dx.all.js

The dxPopover widget is an overlay with an arrow that points to the UI element that has been clicked or tapped. This widget is similar to the dxPopup widget, but the popover window has an arrow that points to an associated UI element.

You can create a widget using one of the following approaches.

  • jQuery
    Use the dxPopover jQuery plug-in.

    HTML
    <div id="popover"></div>
    <div id="targetElement"></div>
    JavaScript
    $("#popover").dxPopover({
        target: "#targetElement",
        showTitle: true,
        title: 'Popover title'
    });
  • Knockout
    Add a div element and apply the dxPopover binding to this element.

    HTML
    <div data-bind="dxPopover: {
        target: "#targetElement",
        showTitle: true,
        title: 'Popover title'
    }"></div>
  • Angular
    Add a div element and apply the dx-popover directive to this element.

    HTML
    <div dx-popover="{
        target: "#targetElement",
        showTitle: true,
        title: 'Popover title'
    }"></div>

Note that DevExtreme widgets require you to link the jQuery and Globalize libraries to your application. If you use the Knockout or Angular approach, the Knockout or Angular library is also required.

See Also

You can find detailed information on the principles of working with the widget in the dxPopover section of the Overlay Widgets article.

View Demo

Watch Video

Show Example:
AngularJS
Knockout
jQuery
<div ng-controller="demoController" style="height: 100%;">
    <div dx-button="{ onClick: togglePopover, text: 'Choose color' }"></div>
    <div dx-popover="{
        width: 200,
        height: 'auto',
        target: '.dx-button',
        bindingOptions: {
            visible: 'visible'
        }
    }">
        <div data-options="dxTemplate: { name: 'content' }">
            <div dx-list="{ dataSource: colors, onItemClick: togglePopover }"></div>
        </div>
    </div>
</div>
var myApp = angular.module('myApp', ['dx']);
myApp.controller("demoController", function ($scope) {
    $scope.visible = false;
    $scope.colors = ["Red", "Green", "Black"];
    $scope.togglePopover = function () {
        $scope.visible = !$scope.visible;
    };
});
angular.element(document).ready(function () {
    angular.bootstrap(document, ['myApp']);
});
body{
    text-align: center;
}
.dx-button{
    margin: 10px;
}
<div data-bind="dxButton: { onClick: togglePopover, text: 'Choose color' }"></div>
<div data-bind="dxPopover: {
    width: 200,
    height: 'auto',
    visible: visible,
    target: '.dx-button'
}">
    <div data-options="dxTemplate: {name: 'content'}">
        <div data-bind="dxList: { dataSource: colors, onItemClick: togglePopover }"></div>
    </div>
</div>
var myViewModel = {
    visible: ko.observable(false),
    colors: ["Red", "Green", "Black"],
    togglePopover: function () {
        this.visible(!this.visible());
    }
}
ko.applyBindings(myViewModel);
body{
    text-align: center;
}
.dx-button{
    margin: 10px;
}
<div id="toggleButton"></div>
<div id="myPopover"></div>
$("#myPopover").dxPopover({
    width: 200,
    height: 'auto',
    target: '#toggleButton',
    contentTemplate: function (contentElement) {
        var list = $("<div>");
        contentElement.append(list);
        list.dxList({
            dataSource: ["Red", "Green", "Black"],
            onItemClick: function () {
                $("#myPopover").dxPopover("instance").hide();
            }
        })
    }
});
$("#toggleButton").dxButton({
    text: 'Choose color',
    onClick: function () {
        $("#myPopover").dxPopover("instance").show();
    }
});
body{
    text-align: center;
}
.dx-button{
    margin: 10px;
}

Configuration

An object defining configuration options for the dxPopover widget.

Methods

This section describes members used to manipulate the widget.

Events

This section describes events exposed by this widget.