UI Widgets Gallery

An image gallery widget.

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

The dxGallery widget displays images in a horizontally scrolled view.

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

  • jQuery
    Use the dxGallery jQuery plug-in.

    HTML
    <div id="gallery"></div>
    JavaScript
    $("#gallery").dxGallery({
        dataSource: galleryData,
        showIndicator: true,
        indicatorEnabled: true,
        showNavButtons: true
    });
  • Knockout
    Add a div element and apply the dxGallery binding to this element.

    HTML
    <div data-bind="dxGallery: {
        dataSource: galleryData,
        showIndicator: true,
        indicatorEnabled: true,
        showNavButtons: true
    }"></div>
  • Angular
    Add a div element and apply the dx-gallery directive to this element.

    HTML
    <div dx-gallery="{
        dataSource: galleryData,
        showIndicator: true,
        indicatorEnabled: true,
        showNavButtons: true
    }"></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

The dxGallery widget supports common Collection Container functionality. You can find detailed information on the principles of working with collection container widgets in the Collection Container Widgets guide. For detailed information on working with the dxGallery widget, refer to the dxGallery guide.

View Demo

Show Example:
AngularJS
Knockout
jQuery
<div ng-controller="demoController" style="height:100%;">
    <div class="gallery" dx-gallery="{ dataSource: galleryData }"></div>
</div>
var myApp = angular.module('myApp', ['dx']);
myApp.controller("demoController", function ($scope) {
    $scope.galleryData = [
        "/Content/images/doc/14_2/PhoneJS/person1.png",
        "/Content/images/doc/14_2/PhoneJS/person2.png",
        "/Content/images/doc/14_2/PhoneJS/person3.png",
        "/Content/images/doc/14_2/PhoneJS/person4.png"
    ];
});
angular.element(document).ready(function () {
    angular.bootstrap(document, ['myApp']);
});
body{
    text-align: center;
}
.gallery{
    margin: 10px;
    height: 370px;
}
<div class="gallery" data-bind="dxGallery: { dataSource: galleryData }"></div>
var myViewModel = {
    galleryData: [
        "/Content/images/doc/14_2/PhoneJS/person1.png",
        "/Content/images/doc/14_2/PhoneJS/person2.png",
        "/Content/images/doc/14_2/PhoneJS/person3.png",
        "/Content/images/doc/14_2/PhoneJS/person4.png"
    ]
}
ko.applyBindings(myViewModel);
body{
    text-align: center;
}
.gallery{
    margin: 10px;
    height: 370px;
}
<div class="gallery" id="myGallery"></div>
$("#myGallery").dxGallery({
    dataSource: [
        "/Content/images/doc/14_2/PhoneJS/person1.png",
        "/Content/images/doc/14_2/PhoneJS/person2.png",
        "/Content/images/doc/14_2/PhoneJS/person3.png",
        "/Content/images/doc/14_2/PhoneJS/person4.png"
    ]
});
body{
    text-align: center;
}
.gallery{
    margin: 10px;
    height: 370px;
}

Configuration

An object defining configuration options for the dxGallery widget.

Methods

This section describes members used to manipulate the widget.

Events

This section describes events exposed by this widget.

Default Item Template

This section lists the data source fields that are used in a default template for gallery 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