2017-03-15 4 views
1

react.jsのMaterial-UIオートコンプリートの値を取得する方法。react.jsのMaterial-ui auto-completeの値を取得する方法

I疲れ

productName: this.refs.productName.value 
productName: this.refs.productName.getValue() 

両方が

<AutoComplete 
      hintText="Product Name" 
     // filter={AutoComplete.noFilter} 
     // filter={AutoComplete.fuzzyFilter} 
      filter={AutoComplete.caseInsensitiveFilter} 
      openOnFocus={true} 
      name="productName" 
      ref="productName" 
      value={this.props.signUpState.productName} 
      dataSource={datasource} 
      floatingLabelText="Product Name" 
      hintText="Product Name" 
      onChange={this.props._inputHandler} 
     // onUpdateInput={this.props.signUpState.handleUpdateInput} 
     // dataSourceConfig={dataSourceConfig} 
     /> 
+1

解決策がまだありません –

答えて

0

this.refs.productName.state.searchText

代替、小道具onUpdateInput

使用を動作していません。

<Autocomplete 
onUpdateInput={this.handleUpdateInput.bind(this)} 
/> 
handleUpdateInput = (searchText) => { 
    console.log(searchText) 
} 
+0

回答ありがとうございます、私は試してみます –

関連する問題