kendo-treeview-react-wrapper datasource

4 posts, 1 answers
  1. Artur
    Artur avatar
    8 posts
    Member since:
    Feb 2018

    Posted 30 Mar 2018 Link to this post

    How could I reload component when dataSource(data) was changed?

    For example, I want add filtering for my treeview.

     

    If I just change dataSource, nothings happens. So,  I need to use "setDatasource". 

  2. Stefan
    Admin
    Stefan avatar
    2922 posts

    Posted 02 Apr 2018 Link to this post

    Hello, Artur,

    The TreeView component can be filtered using the filter method of its data source:

    http://https//docs.telerik.com/kendo-ui/api/javascript/data/datasource/methods/filter

    I made an example demonstrating this:

    https://plnkr.co/edit/UbxEpLTYgwLrc7EsySKh?p=preview

    componentDidMount() {
      var treeView = $("[data-role='treeview']").data("kendoTreeView")
      treeView.dataSource.filter({field:"id", operator:"eq", value:1})
    }

    I hope this is helpful.

    Regards,
    Stefan
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Artur
    Artur avatar
    8 posts
    Member since:
    Feb 2018

    Posted 02 Apr 2018 in reply to Stefan Link to this post

    Thank you for answer. But is is not what I need...

    For example, I have input + Treeview.  Treeview data depends on component's props. I want to update my treeview after I entered the text.

    I know that I can use kendoUI(jQuery) api. But could I do it without explicit using kendoUI Api?

  4. Answer
    Stefan
    Admin
    Stefan avatar
    2922 posts

    Posted 02 Apr 2018 Link to this post

    Hello, Artur,

    As the wrappers are jQuery based, all of the operations and data manipulations have to be done via the components API.

    As they are not native React components they cannot take full advantage of the React components lifecycles and state changes. All of the manipulations have to be done via the API methods as otherwise the components will not re-rendered based on the new data.

    We understand that this may not be the perfect approach, that is why we are preparing native components which will take full advantage of the React library and its best practices.

    Regards,
    Stefan
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top