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

kendo-treeview-react-wrapper datasource

3 Answers 131 Views
Wrappers for React
This is a migrated thread and some comments may be shown as answers.
Artur
Top achievements
Rank 1
Artur asked on 30 Mar 2018, 03:05 PM

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". 

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 02 Apr 2018, 07:48 AM
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
0
Artur
Top achievements
Rank 1
answered on 02 Apr 2018, 08:48 AM

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?

0
Accepted
Stefan
Telerik team
answered on 02 Apr 2018, 08:57 AM
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
Tags
Wrappers for React
Asked by
Artur
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Artur
Top achievements
Rank 1
Share this question
or