loadOnDemand.valueMapper Function

The component calls the valueMapper function when the component receives a value, that is not fetched from the remote server yet. The component will pass the selected value(s) in the valueMapper function. In turn, the valueMapper implementation should return the respective data item(s) ids.

The valueMapper needs dataSource.schema to work properly.

Example

<input id="dropdowntree">
<script>
  $("#dropdowntree").kendoDropDownTree({
    dataTextField: "FullName",
    dataValueField: "EmployeeId",
    loadOnDemand: {
      valueMapper: function (options) {
        options.success([[2, 8]]);
      }
    },
    dataSource: {
      transport: {
        read: {
          url: "https://demos.telerik.com/kendo-ui/service/Employees",
          dataType: "jsonp"
        }
      },
      schema: {
        model: {
          id: "EmployeeId",
          hasChildren: "HasEmployees"
        }
      }
    },
    value: '8'
  });
</script>
In this article