New to Telerik Reporting? Download free 30-day trial

How to Create a Custom Parameter Editor

The article elaborates on how to change the default editors for visible parameters in the React Report Viewer's Parameters Area.

Custom parameter editors are defined through the parameterEditors array passed as an option when creating the report viewer widget. Each object represents a parameter editor factory for creating editors suitable to edit a specific report parameter configuration.

Setting the Custom Parameter Editor

The following example illustrates how to use the Kendo DateTimePicker widget for a DateTime parameter:

  1. Each editor is an object which contains two methods: match and createEditor.

    function match(parameter) {
        return parameter.type === "System.DateTime";
    function createEditor(placeholder, options) {
        var dateTimePicker = $(placeholder).html('<input type="datetime"/>'),
        valueChangedCallback = options.parameterChanged,
        function onChange() {
            var val = dropDownList.value();
            valueChangedCallback(parameter, val);
        return {
            beginEdit: function (param) {
                parameter = param;
                    dataTextField: "name",
                    dataValueField: "value",
                    value: parameter.value,
                    dataSource: parameter.availableValues,
                    change: onChange
                dropDownList = $(dateTimePicker).find("input").data("kendoDateTimePicker");
  2. The viewer is using a special Kendo subset that contains only the required widgets and the Kendo DateTimePicker widget is not part of the subset. For that reason, we need to load the Kendo All script. Note that currently, we need to use this special logic for loading the viewer to the fact that jQuery has to be loaded before Kendo All:

    let viewer;
    function loadScript(callback) {
        const script = document.createElement("script");
        script.src = "";
        script.async = true;
        script.onload = callback;
    class App2 extends Component {
        componentDidMount() {
            loadScript(() => {
                this.setState({ visible: true });
        render() {
            return this.state?.visible ? (<div>
                ref={el => viewer = el}     
                    report: 'MyReport.trdp',
                    parameters: {}
                    match: match,
                    createEditor: createEditor
                }} />
            </div>) : null;

See Also

In this article