Error Found: How To Create a Custom Parameter Editor

2 posts, 0 answers
  1. Daniel
    Daniel avatar
    1 posts
    Member since:
    Feb 2013

    Posted 03 Feb 2015 Link to this post

    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>
  2. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 05 Feb 2015 Link to this post

    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.

     
Back to Top