DeferRendering

The DeferRendering is a widget that waits for its content to be ready before rendering it. While the content is getting ready, the DeferRendering displays a loading indicator.

Included in: dx.mobile.js, dx.web.js, dx.viz-web.js, dx.all.js
Export: default

DevExtreme widgets are integrated with many popular libraries and frameworks. See the Installation section (for JavaScript libraries) or the Prerequisites and Installation section (for ASP.NET MVC framework) to find details on setting up DevExtreme with a particular library or framework.

The following code shows how to create the DeferRendering widget using every supported library and framework. For more details on working with widgets in these libraries and frameworks, see the Widget Basics topic for jQuery, Angular, AngularJS, Knockout or ASP.NET MVC.

jQuery
HTML
JavaScript
<div id="deferRendering">
    <!-- Widget content -->
</div>
var readyToRender = $.Deferred();
// Here goes a function that resolves the "readyToRender" Deferred object at a specific moment
// ...
$(function () {
    $("#deferRendering").dxDeferRendering({
        renderWhen: readyToRender.promise();
    });
});
Angular
HTML
TypeScript
<dx-defer-rendering
    [renderWhen]="modelReady"
>
    <!-- Widget content -->
</dx-defer-rendering>
var modelIsReady = $.Deferred();
// Here goes a function that resolves the "readyToRender" Deferred object at a specific moment
// ...
export class AppComponent
    modelReady = modelIsReady.promise();
}
AngularJS
HTML
JavaScript
<div ng-controller="DemoController">
    <div dx-defer-rendering="{
        renderWhen: modelIsReady
    }">
        <!-- Widget content -->
    </div>
</div>
var modelIsReady = $.Deferred();
// Here goes a function that resolves the "readyToRender" Deferred object at a specific moment
// ...
angular.module('DemoApp', ['dx'])
    .controller("DemoController", function ($scope) {
        $scope.modelIsReady = modelIsReady.promise();
    });
Knockout
HTML
JavaScript
<div data-bind="dxDeferRendering: {
    renderWhen: modelIsReady
}">
    <!-- Widget content -->
</div>
var modelIsReady = $.Deferred();
// Here goes a function that resolves the "readyToRender" Deferred object at a specific moment
// ...
var viewModel = {
    modelIsReady: modelIsReady.promise()
};
ko.applyBindings(viewModel);
See Also
Show Example:
jQuery

Configuration

An object defining configuration options for the widget.

Methods

This section describes members used to manipulate the widget.

Events

This section describes events fired by this widget.

See Also