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
    JavaScript
    <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>
    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"
        });
    });
  • Angular

    HTML
    JavaScript
    <dx-tile-view
        [dataSource]="states"
        itemTemplate="tile">
            <div *dxTemplate="let tileData of 'tile'">
                <p style="font-size:larger"><b> {{ tileData.state }} </b></p>
                <p>Capital: <i> {{ tileData.capital }} </i></p>
                <p>Population: <i> {{ tileData.population }} </i></p>
            </div>
    </dx-tile-view>
    export class AppComponent {
        states = [
            // ...
        ];
    }
  • AngularJS

    HTML
    JavaScript
    <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>
    angular.module('DemoApp', ['dx'])
        .controller("DemoController", function ($scope) {
            $scope.states = [
                // ...   
            ];
        });
  • Knockout

    HTML
    JavaScript
    <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>
    var viewModel = {
        states: [
            // ...
        ]
    };
    ko.applyBindings(viewModel);
  • ASP.NET MVC Wrappers

    Razor C#
    Razor VB
    @(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>)
    )
    @Code
        Html.DevExtreme().TileView() _
            .ID("tileView") _
            .DataSource(States) _
            .ItemTemplate(Sub()
                @<text>
                    <p style="font-size:larger"><b> <%= state %> </b></p>
                    <p>Capital: <i> <%= capital %> </i></p>
                    <p>Population: <i> <%= population %> </i></p>
                </text>
            End Sub).Render()
    End Code

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