9 Answers, 1 is accepted
Could you give an example of how your data is structured?
Regards,
Vasil
Progress Telerik
Hi Vasil
Apologises for the delay in coming back to you.
My data is pulled from the Microsoft Graph and populates an array
___________________________________
resultData.d.results.forEach (
views => {
this.MYARRAY. push ({
key: mykey,
text: myText
});
});
_________________________________
My kendo dropdown list is as follows
<DropDownList
name="myDropDown"
data={this.state.selected}
textField="text"
filterable={true}
onFilterChange={this.filterChange}
onChange = {(event) => this.handleChange('event.target.value) }
style={{ width: "300px" }}
/>
my Clear for the drop down is
Selected: this.MYARRAY.slice(),
______________________________
Ive also tried
Selected: {"key": ''; "text": ''}
but doesnt work
______________________
its pretty much
https://www.telerik.com/kendo-react-ui/components/dropdowns/dropdownlist/filtering/
this sample from the stie
The filter value can be controlled using the filter prop of the DropDown.
https://www.telerik.com/kendo-react-ui/components/dropdowns/api/DropDownListProps/#toc-filter
I made an example showcasing how to clear the filter value:
https://stackblitz.com/edit/react-pew4cw?file=app/main.jsx
I hope this is helpful.
Regards,
Stefan
Progress Telerik
Thanks for that Stefan - how can I also clear the selection? When I hit clear in the example its still set?
I'm glad to hear that the issue is resolved.
For anyone else finding this thread on the later state, I want to clarify that this is done by setting the DropDownList in controlled mode and resetting the value:
https://www.telerik.com/kendo-react-ui/components/dropdowns/dropdownlist/binding/#toc-value-binding
Regards,
Stefan
Progress Telerik