UI Widgets Panorama

A widget displaying the required content in a long horizontal canvas that extends beyond the frames of the screen.

Included in: dx.phonejs.js, dx.all.js
Panorama interactive configuration
Copy code
$("#panorama").dxPanorama({
});

dxPanorama is a full screen widget that allows you to locate widgets, display data and provide services by using a long horizontal canvas that extends beyond the frames of the screen. Content is divided into items that can be explored by panning and flicking. When viewing an item, you will be able to see a portion of the item next to it. This widget is often used as a navigation map on the first page of an application. Although dxPanorama was designed based on the native WindowsPhone8 Panorama widget, it can be used on any platform.

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

  • jQuery
    Use the dxPanorama jQuery plug-in.

    HTML
    <div id="panorama"></div>
    JavaScript
    $("#panorama").dxPanorama({
        dataSource: panoramaData,
        title: 'Panorama title',
        backgroundImage: '/images/panoramaBG.png'
    });
  • Knockout
    Add a div element and apply the dxPanorama binding to this element.

    HTML
    <div data-bind="dxPanorama: {
        dataSource: panoramaData,
        title: 'Panorama title',
        backgroundImage: '/images/panoramaBG.png'
    }"></div>
  • Angular
    Add a div element and apply the dx-panorama directive to this element.

    HTML
    <div dx-panorama="{
        dataSource: panoramaData,
        title: 'Panorama title',
        backgroundImage: '/images/panoramaBG.png'
    }"></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. For detailed information on linking these libraries to your project, refer to the Installation article.

Since the dxPanorama widget is used to display multiple items, it supports common Collection Container widget functionality. You can find detailed information on the principles of working with the widget in the dxPanorama section of the Collection Container Widgets article.

View Demo

Watch Video

Show Example:
AngularJS
Knockout
jQuery
<div ng-controller="demoController" style="height:100%;">
    <div dx-panorama="{
        title: 'Online restaurant',
        dataSource: panoramaData,
        onItemClick: processItemClick,
        backgroundImage: {
            url: '/Content/images/panorama_bg.png',
            height: 407,
            width: 500
        }
    }">
        <div data-options="dxTemplate : { name: 'item' } ">
            <div>{{text}}</div>
            <div>
                <img ng-repeat="image in images" ng-attr-src="{{image.src}}"/>
            </div>
        </div>
    </div>
</div>
var food = {
    desserts: [
        { src: "/content/data/products/06.jpg" },
        { src: "/content/data/products/16.jpg" },
        { src: "/content/data/products/19.jpg" },
        { src: "/content/data/products/21.jpg" },
        { src: "/content/data/products/22.jpg" },
        { src: "/content/data/products/25.jpg" }
    ],
    mainCourses: [
        { src: "/content/data/products/04.jpg" },
        { src: "/content/data/products/05.jpg" },
        { src: "/content/data/products/14.jpg" },
        { src: "/content/data/products/17.jpg" },
        { src: "/content/data/products/23.jpg" },
        { src: "/content/data/products/28.jpg" }
    ],
    seafood: [
        { src: "/content/data/products/46.jpg" },
        { src: "/content/data/products/45.jpg" },
        { src: "/content/data/products/73.jpg" },
        { src: "/content/data/products/30.jpg" },
        { src: "/content/data/products/13.jpg" },
        { src: "/content/data/products/41.jpg" }
    ],
    drinks: [
        { src: "/content/data/products/01.jpg" },
        { src: "/content/data/products/02.jpg" },
        { src: "/content/data/products/24.jpg" },
        { src: "/content/data/products/34.jpg" },
        { src: "/content/data/products/35.jpg" },
        { src: "/content/data/products/38.jpg" }
    ]
};

var myApp = angular.module('myApp', ['dx']);
myApp.controller("demoController", function ($scope) {
    $scope.panoramaData = [
        {
            header: "Main courses",
            text: "First and second course of a meal",
            images: food.mainCourses
        },
        {
            header: "Seafood",
            text: "Seafood: ocean and sea",
            images: food.seafood
        },
        {
            header: "Desserts",
            text: "Desserts: biscuits and cookies",
            images: food.desserts
        },
        {
            header: "Drinks",
            text: "Drinks: Soft vine and tea",
            images: food.drinks
        }
    ];
    $scope.processItemClick = function (e) {
        DevExpress.ui.dialog.alert(e.itemData.text);
    };
});
angular.element(document).ready(function () {
    angular.bootstrap(document, ['myApp']);
});
<div data-bind="dxPanorama: {
        title: 'Online restaurant',
        dataSource: panoramaData,
        onItemClick: processItemClick,
        backgroundImage: {
            url: '/Content/images/panorama_bg.png',
            height: 407,
            width: 500
        }
    }">
    <div data-options="dxTemplate : { name: 'item' } ">
        <div data-bind="text: text"></div>
        <div data-bind="foreach: images">
            <img data-bind="attr: { src: src }" />
        </div>
    </div>
</div>
var food = {
    desserts: [
        { src: "/content/data/products/06.jpg" },
        { src: "/content/data/products/16.jpg" },
        { src: "/content/data/products/19.jpg" },
        { src: "/content/data/products/21.jpg" },
        { src: "/content/data/products/22.jpg" },
        { src: "/content/data/products/25.jpg" }
    ],
    mainCourses: [
        { src: "/content/data/products/04.jpg" },
        { src: "/content/data/products/05.jpg" },
        { src: "/content/data/products/14.jpg" },
        { src: "/content/data/products/17.jpg" },
        { src: "/content/data/products/23.jpg" },
        { src: "/content/data/products/28.jpg" }
    ],
    seafood: [
        { src: "/content/data/products/46.jpg" },
        { src: "/content/data/products/45.jpg" },
        { src: "/content/data/products/73.jpg" },
        { src: "/content/data/products/30.jpg" },
        { src: "/content/data/products/13.jpg" },
        { src: "/content/data/products/41.jpg" }
    ],
    drinks: [
        { src: "/content/data/products/01.jpg" },
        { src: "/content/data/products/02.jpg" },
        { src: "/content/data/products/24.jpg" },
        { src: "/content/data/products/34.jpg" },
        { src: "/content/data/products/35.jpg" },
        { src: "/content/data/products/38.jpg" }
    ]
};

var myViewModel = {
    panoramaData: [
        {
            header: "Main courses",
            text: "First and second course of a meal",
            images: food.mainCourses
        },
        {
            header: "Seafood",
            text: "Seafood: ocean and sea",
            images: food.seafood
        },
        {
            header: "Desserts",
            text: "Desserts: biscuits and cookies",
            images: food.desserts
        },
        {
            header: "Drinks",
            text: "Drinks: Soft vine and tea",
            images: food.drinks
        }
    ],
    processItemClick: function (e) {
        DevExpress.ui.dialog.alert(e.itemData.text);
    }
}
ko.applyBindings(myViewModel);
<div id="myPanorama"></div>
var food = {
    desserts: [
        { src: "/content/data/products/06.jpg" },
        { src: "/content/data/products/16.jpg" },
        { src: "/content/data/products/19.jpg" },
        { src: "/content/data/products/21.jpg" },
        { src: "/content/data/products/22.jpg" },
        { src: "/content/data/products/25.jpg" }
    ],
    mainCourses: [
        { src: "/content/data/products/04.jpg" },
        { src: "/content/data/products/05.jpg" },
        { src: "/content/data/products/14.jpg" },
        { src: "/content/data/products/17.jpg" },
        { src: "/content/data/products/23.jpg" },
        { src: "/content/data/products/28.jpg" }
    ],
    seafood: [
        { src: "/content/data/products/46.jpg" },
        { src: "/content/data/products/45.jpg" },
        { src: "/content/data/products/73.jpg" },
        { src: "/content/data/products/30.jpg" },
        { src: "/content/data/products/13.jpg" },
        { src: "/content/data/products/41.jpg" }
    ],
    drinks: [
        { src: "/content/data/products/01.jpg" },
        { src: "/content/data/products/02.jpg" },
        { src: "/content/data/products/24.jpg" },
        { src: "/content/data/products/34.jpg" },
        { src: "/content/data/products/35.jpg" },
        { src: "/content/data/products/38.jpg" }
    ]
};

$("#myPanorama").dxPanorama({
    dataSource: [
        {
            header: "Main courses",
            text: "First and second course of a meal",
            images: food.mainCourses
        },
        {
            header: "Seafood",
            text: "Seafood: ocean and sea",
            images: food.seafood
        },
        {
            header: "Desserts",
            text: "Desserts: biscuits and cookies",
            images: food.desserts
        },
        {
            header: "Drinks",
            text: "Drinks: Soft vine and tea",
            images: food.drinks
        }
    ],
    itemTemplate: function (itemData, itemIndex, itemElement) {
        itemElement.append("<div>" + itemData.text + "</div>");
        var imageWrapper = $("<div>");
        itemElement.append(imageWrapper);
        for(var i = 0; i<itemData.images.length; i++)
            imageWrapper.append('<img src="' + itemData.images[i].src + '"/>');
    },
    onItemClick: function (e) {
        DevExpress.ui.dialog.alert(e.itemData.text);
    },
    backgroundImage: {
        url: '/Content/images/panorama_bg.png',
        height: 407,
        width: 500
    }
});

Configuration

An object defining configuration options for the dxPanorama widget.

Methods

This section describes members used to manipulate the widget.

Events

This section describes events fired by this widget.

Default Item Template

This section lists the data source fields that are used in a default template for panorama items.

By default, a predefined item template is applied to display the items of this widget. This template is based on certain fields of the data source provided for this widget. Below is the list of these fields. If the default item template is not appropriate for your task, implement a custom item template based on these or other fields of your data source.

See Also