kendoui scheduler hierarchical grouping - access parentValue into a resource template

55 Views Asked by At

https://demos.telerik.com/kendo-ui/scheduler/resources-grouping-hierarchical

is it possible to access to the value of parentValue into a kendo resource template???

i've created a template for the scheduler's resources but seems possible to access only these fields and parentValue is undefined

<script id="groupHeaderTemplate" type="text/x-kendo-template">
      <span>name: #=name#</span><br/>
      <span>text: #=text#</span><br/>
      <span>title: #=title#</span><br/>
      <span>field: #=field#</span><br/>
      <span>value: #=value#</span><br/>
      <span>parentValue: #=parentValue#</span><br/>  //this is undefined
</script>


childResourceDataSource = new kendo.data.DataSource({
                type: "webapi", 
                transport: {
                  read: "/turnazione/gestioneturni/OnGetDipendentiByPuntoVenditaResources",
                },
                serverFiltering: true,
                schema: {
                  model: {
                    id: "value",
                    fields: {
                      value: { type: "number" },
                      text: { type: "text" },
                      parentValue: { type: "text" },
                    }
                  }
                },
                sort: { field: "text", dir: "asc" },
              });

and the following are the real data

[
  { "value": 3, "text": "Alberto Giacomelli", "parentData": 55 },
  { "value": 5, "text": "Roberto Cacciatori", "parentData": 55 },
  { "value": 6, "text": "Giacomo Giordano", "parentData": 99 },
  { "value": 8, "text": "alessio pinato", "parentData": 99 }
]
1

There are 1 best solutions below

0
Aleksandar On

According to the API these are the fields passed to the groupHeaderTemplate:

The fields which can be used in the template are:

text - the group text
color - the group color
value - the group value
field - the field of the scheduler event which contains the resource id
title - the 'title' option of the resource
name - the 'name' option of the resource

So it doesn't seem that any additional data is passed to the template.