0
我想在dropzone中使用可点击的选项。我正在使用dropzone组件,如下所示link.在dropzone中使用可点击的初始配置选项
我正在使用以下配置呈现dropzone。
let djsConfig = {
addRemoveLinks: true,
acceptedFiles: 'image/jpeg,image/png,image/gif,application/pdf,application/txt',
clickable: false,
autoProcessQueue: false,
};
下面的代码是生成视图的render方法的return语句。
return(
<div>
<DropzoneComponent
config={componentConfig}
eventHandlers={eventHandlers}
djsConfig={djsConfig}
/>
<DropDownMenu
value={this.state.value}
onChange={this.handleChange}
>
<MenuItem value={0} primaryText="Select Document Type" />
<MenuItem value={1} primaryText="Pan Card" />
<MenuItem value={2} primaryText="Votar Id" />
<MenuItem value={3} primaryText="Certificate" />
<MenuItem value={4} primaryText="Passports" />
</DropDownMenu>
</div>
);
我想使用handleChange方法,如comment中所述。
handleChange = (event, index, value) => {
/*
When dropdown value is 0 then it dropzone should not be clickable and
and after dropdown have some value > 0, dropzone should be clickable.
*/
this.setState({ value });
};