ValidationSummary

A widget for displaying the result of checking validation rules for editors.

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

This widget has a collection of items that present the validation errors that currently exist in a validation group or the ViewModel to which the widget is related.

dxValidationSummary Widget

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

  • jQuery
    Use the dxValidationSummary jQuery plug-in.

    HTML
    <div id="textBox1"></div>
    <div id="textBox2"></div>
    <div id="summary"></div>
    <div id="button"></div>
    JavaScript
    var validationGroup = "sampleGroup";
     $("#textBox1").dxTextBox({})
        .dxValidator({
            validationRules: []
        });
    $("#textBox2").dxTextBox({})
        .dxValidator({
            validationRules: []
        });
    $("#summary").dxValidationSummary({ });
    $("#button").dxButton({});
  • Knockout
    Add a div element and apply the dxValidationSummary binding to this element.

    HTML
    <div data-bind="dxTextBox: { },
        dxValidator: { validationRules: [] }">  
    </div>
    <div data-bind="dxTextBox: { },
        dxValidator: { validationRules: [] }"> 
    </div>  
    <div data-bind="dxValidationSummary: { }"></div>
    <div data-bind="dxButton: { }"></div>
  • Angular
    Add a div element and apply the dx-validation-group directive to this element.

    HTML
    <div ng-controller="demoController">
        <div dx-text-box="{  }"
            dx-validator="{ validationRules:  }">  
        </div>
        <div dx-text-box="{  }"
            dx-validator="{ validationRules:  }">  
        </div>
        <div dx-validation-summary="{  }"></div>
        <div dx-button="{ }"></div>
    </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 summary items are displayed using the default item template that is based on the message field of the broken validation rule. However, you can use a custom item template.

See Also

NOTE: The currently existing validation errors are not only the errors that are discovered during the current validation, but also the validation errors that are discovered during the earlier validations if the not-valid values are not changed since then.

To learn more on how to create the dxValidationSummary widget and associate it with the required validation group or ViewModel, refer to the Display Validation Errors and Validate View Model topics.

See Also
Show Example:
AngularJS
Knockout
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 exposed by this widget.