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

How do I use serverFiltering with read in TreeView

1 Answer 43 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Grant
Top achievements
Rank 2
Veteran
Iron
Grant asked on 15 Nov 2016, 03:24 PM

Hi, 

So I have Treeview that reads Channel Data from a remote Hierarchical DataSource:

var hierarchical_dataSource_channelNodes = new kendo.data.HierarchicalDataSource({
  transport: {
    read: {
      url: "/planner/channelnodes/forTree",
      type: "GET",
      dataType: "json"
    }
  },
  schema: {
    model: {
      id: "id",
      hasChildren: "hasChildChannelNodes"
    }
  }
});

 

So as above, tree nodes (child channels) are retrieved on an as needed bases, when a node is opened, this is donw by executing this URL: "/planner/channelnodes/forTree/1" (for example I expans the first node).

So this is where my issue starts, Id like to implement serverFitlering as well, how can I also execute a filter (ie. add the filter param to the URL) when a tree node is expanded and the read URL is executed? Is there a way to execute a read and filter together or to append the 'filter' param & value to the read URL during a 'requestStart' or 'parameterMap' or a read request?

Thanks and kind Regards,
Grant

1 Answer, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 16 Nov 2016, 08:21 AM
Hello Grant,

The desired result can be achieved by passing the additional parameters to the server using the transport.read.data property of the DataSource:

http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-transport.read.data

Please check a thread in our forum on similar subject for the different approaches that can be used in this scenario:

http://www.telerik.com/forums/remote-datasource-filtering

I hope this will help to achieve the desired result.

Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
TreeView
Asked by
Grant
Top achievements
Rank 2
Veteran
Iron
Answers by
Stefan
Telerik team
Share this question
or