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.
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>