This is a migrated thread and some comments may be shown as answers.

Error Found: How To Create a Custom Parameter Editor

1 Answer 155 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 03 Feb 2015, 11:14 PM
Good afternoon,

While working with a report viewer I found an error in the example: How To: Create a Custom Parameter Editor. In the code example the createEditor method makes a call to a jQuery function that sets the html for the element that you pass to the placeholder parameter. The call in the example is misspelled.

Please find the code example below for a working version.  
//misspelled
$(placeholder).htmll('<div></div>');
//should be
$(placeholder).html('<div></div>');

//Code example fixed
<script type="text/javascript">
  $("#reportViewer1")
  .telerik_ReportViewer({          
   parameterEditors: [
    {
     match: function (parameter) {
      return Boolean(parameter.availableValues) && !parameter.multivalue;
     },     createEditor: function (placeholder, options)  {
      var dropDownElement = $(placeholder).html('<div></div>'),
          parameter,
          valueChangedCallback = options.parameterChanged,
          dropDownList;          function onChange() {
         var val = dropDownList.value();
        valueChangedCallback(parameter, val);
         }      return {
       beginEdit: function (param) {        parameter = param;        $(dropDownElement).kendoDropDownList({
         dataTextField: "name",
         dataValueField: "value",
         dataSource: parameter.availableValues,
         change: onChange
        });        dropDownList = $(dropDownElement).data("kendoDropDownList");
       }
      };
     }
     }]
  });       
</script>

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 05 Feb 2015, 01:13 PM
Hello Daniel,

Thank you for contacting us.

This is a known issue in our online documentation. The code snippet is correct in the local CHM file.
In addition, please check the settings illustrated in the HTML5 Telerik Reporting DropDown forum thread (the documentation will be updated with the mentioned settings in future releases).


Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Daniel
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or