TileView

The TileView widget contains a collection of tiles. Tiles can store much more information than ordinary buttons, that is why they are very popular in apps designed for touch devices.

Included in: dx.mobile.js, dx.web.js, dx.viz-web.js, dx.all.js
Module: ui/tile_view
Export: default
TileView interactive configuration
Copy Code
Copy to Codepen
$("#tileview").dxTileView({
});

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

  • jQuery

    HTML
    <div id="tileView">
        <div data-options="dxTemplate: { name: 'tile' }">
            <p style="font-size:larger"><b data-bind="text: state"></b></p>
            <p>Capital: <i data-bind="text: capital"></i></p>
            <p>Population: <i data-bind="text: population"></i></p>
        </div>
    </div>
    JavaScript
    var states = [
        { state: "Alabama", capital: "Montgomery", population: 4822023 },
        { state: "Alaska", capital: "Juneau", population: 731449 },
        { state: "Arizona", capital: "Phoenix", population: 6553255 },
        // ...
    ];
    $(function() {
        $("#tileView").dxTileView({
            dataSource: states,
            itemTemplate: "tile"
        });
    });
  • AngularJS

    HTML
    <div dx-tile-view="{
        dataSource: states,
        itemTemplate: 'tile'
    }" dx-item-alias="itemObj">
        <div data-options="dxTemplate: { name: 'tile' }">
            <p style="font-size:larger"><b> {{ itemObj.state }} </b></p>
            <p>Capital: <i> {{ itemObj.capital }} </i></p>
            <p>Population: <i> {{ itemObj.population }} </i></p>
        </div>
    </div>
    JavaScript
    angular.module('DemoApp', ['dx'])
        .controller("DemoController", function ($scope) {
            $scope.states = [
                // ...   
            ];
        });
  • Knockout

    HTML
    <div data-bind="dxTileView: {
        dataSource: states,
        itemTemplate: 'tile'
    }">
        <div data-options="dxTemplate: { name: 'tile' }">
            <p style="font-size:larger"><b data-bind="text: state"></b></p>
            <p>Capital: <i data-bind="text: capital"></i></p>
            <p>Population: <i data-bind="text: population"></i></p>
        </div>
    </div>
    JavaScript
    var viewModel = {
        states: [
            // ...
        ]
    };
    ko.applyBindings(viewModel);
  • ASP.NET MVC Wrappers

    @(Html.DevExtreme().TileView()
        .ID("tileView")
        .DataSource(States)
        .ItemTemplate(@<text>
            <p style="font-size:larger"><b> <%= state %> </b></p>
            <p>Capital: <i> <%= capital %> </i></p>
            <p>Population: <i> <%= population %> </i></p>
        </text>)
    )

Note that DevExtreme widgets require you to link the jQuery library to your application. If you use the Knockout or AngularJS approach, the Knockout or AngularJS library is also required. For detailed information on linking these libraries to your project, refer to the topics in the Installation section.

View Demo

See Also
Show Example:
AngularJS
Knockout
jQuery

Configuration

An object defining configuration options for the TileView 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 tile view 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 a 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