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

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.

This widget, like any other DevExtreme UI widget, can be created using one of three possible approaches: jQuery, Knockout or AngularJS. The following code demonstrates how to create the dxPanorama widget using the Knockout approach.

HTML
<div data-bind="dxPanorama: {
        dataSource: items,
        title: 'Online restaurant'
    }">  
</div>

The panorama items are loaded from an array specified using the dataSource configuration option.

JavaScript
items = [
    {
        header: "Main courses",
        text: "First and second course of a meal"
    },
    {
        header: "Seafood",
        text: "Seafood: ocean and sea"
    },
    {
        header: "Desserts",
        text: "Desserts: biscuits and cookies"
    },
    {
        header: "Drinks",
        text: "Drinks: Soft vine and tea"
    }
]

To display panorama items, a default template is applied based on the following fields of the data source item objects.

  • disabled
    Specifies whether or not the panorama item is disabled
  • visible
    Specifies whether or not the panorama item is visible
  • html
    Specifies the html markup inserted into the item element
  • text
    Specifies the text inserted into the item element
  • header
    Specifies the name for the panorama item

To learn more about the fields used in the default item template, refer to the Default Item Template reference section of the widget.

You can introduce a custom template for panorama items. For this purpose, add a div element with the data-options attribute set to dxTemplate. Assign item to the template name. In this instance, this template will be applied automatically. See the Customize Widget Item Appearance topic to learn more about templates.

HTML
<div data-bind="dxPanorama: { title: 'Online restaurant', dataSource: items }">
    <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>
See Also
  • To learn how to create widgets in detail, refer to the Create a Widget article.
  • The dxPanorama widget is related to the Collection Containers category. So read an overview of the features that are common for collection container widgets in the Common Tasks topic of the Collection Containers article.

Watch Video

Show Example:
jQuery
<div data-bind="dxPanorama: { title: 'Online restaurant', dataSource: items, 
	itemClickAction: function (e) { DevExpress.ui.dialog.alert(e.itemData.text); }  }">
	<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>
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" }
    ]
};

items = [
    {
        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
    }
]

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 component.

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 items of DevExtreme collection widgets. This template is based on certain fields of the data source provided for a widget. Below is the list of the fields that take part in a default item template for the dxPanorama widget. 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. For details refer to the Customize Widget Item Appearance topic.