2017-04-18 4 views
0

multiselect에 모든 속성을 선택하고 싶습니다. onSelectAll을 추가했으나 모두 선택 옵션을 볼 수 없습니다.onSelectAll 옵션이 반응 부팅 스트랩 다중 선택에서 작동하지 않습니다

아래 코드를 참조하십시오.

<Multiselect 
    data={this.props.list} 
    multiple 
    ref="industry" 
    onSelectAll 
    onChange={this.handleDropdown.bind(this, 'industry')} 
    buttonText={function(options, select) { 
        return 'Industry ('+ options.length+')'; }} 
/> 

나는 무엇이 있습니까?

답변

0

includeSelectAllOption을 추가해야합니다. 이것은 원래 플러그인 here

<Multiselect 
data={this.props.list} 
includeSelectAllOption 
multiple 
ref="industry" 
onSelectAll={this.selectAll} 
onChange={this.handleDropdown.bind(this, 'industry')} 
buttonText={function(options, select) { 
       return 'Industry ('+ options.length+')'; }} 

/>

귀하의 onSelectAll해야하는 기능에 설명되어 있습니다. 이 함수는 사용자가 드롭 다운에서 Select all을 선택할 때 호출됩니다.