javascript - How to reset selected items from the list? -


in component of office 365 fabric reactjs exists such component. has _getselectiondetails() method counts selected items list want make method reset , deselect items in list. example have button , when press it, reset items in list, marked before. tried :

_resetselecteditems() :{  this.setstate ({ selectiondetails: 0 })  } 

after call it, sets new state , sets 0, items selected before remain selected, diselecting doesn't happen. how can deselect items?

this.setstate() performs shallow merge of this.state new state, e.g. if this.state have selectiondetails , many more objects. this.setstate ({ selectiondetails: 0 }) update selectiondetails other remain unchange. have cleanup other objects manually.

ref : this.setstate

update :

finally got it.... this._selection.setallselected(false) work.

check out github project or check online.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -