Skip to main content

WebDocumentViewerClientSideEvents.CustomizeParameterLookUpSource Property

Gets or sets the name of the JavaScript function or the entire code to handle the CustomizeParameterLookUpSource event.

Namespace: DevExpress.XtraReports.Web

Assembly: DevExpress.XtraReports.v24.1.Web.WebForms.dll

NuGet Package: DevExpress.Web.Reporting

Declaration

[DefaultValue("")]
public string CustomizeParameterLookUpSource { get; set; }

Property Value

Type Default Description
String String.Empty

A string that specifies the name of a JavaScript function or the entire JavaScript function code.

Remarks

The CustomizeParameterLookUpSource event allows you to customize lookup parameter values.

Example: Specify Lookup Editor Data Sources

The following code specifies a controller route, a JSON resource, and a simple array as report parameter’s data sources on the client. The CustomizeParameterEditors event is handled to specify the data source fields for the lookup editor.

<script type="text/javascript">
    var products = [
        "HD Video Player",
        "SuperHD Video Player",
        "SuperPlasma 50"
    ].map(function (val) { return { value: val, displayValue: val }; });

    function customParameterLookUpSource(s, e) {
        if (e.parameter.name == "parameter1") {
            e.dataSource = "/Home/GetData";
        };
        if (e.parameter.name == "parameter2") {
            e.dataSource = "https://jsonplaceholder.typicode.com/users";
        };
        if (e.parameter.name == "parameter3") {
            e.dataSource = products;
        }  
    }

    function customizeParameterEditors(s, e) {
        if (e.parameter.name == "parameter2") {
            e.info.editor = $.extend({}, e.info.editor);
            e.info.editor.extendedOptions = $.extend(e.info.editor.extendedOptions || {}, {
                valueExpr: 'username',
                displayExpr: 'name'
            });
        }
    }
</script>
@Html.DevExpress().WebDocumentViewer(settings => {
    settings.Name = "WebDocumentViewer1";
    settings.ClientSideEvents.CustomizeParameterEditors = "customizeParameterEditors";
    settings.ClientSideEvents.CustomizeParameterLookUpSource = "customParameterLookUpSource";
}).Bind("TestReport").GetHtml()
See Also