How do I use serverFiltering with read in TreeView

2 posts, 1 answers
  1. Grant
    Grant avatar
    80 posts
    Member since:
    Jul 2016

    Posted 15 Nov 2016 Link to this post

    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

  2. Answer
    Stefan
    Admin
    Stefan avatar
    1007 posts

    Posted 16 Nov 2016 Link to this post

    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.
Back to Top