import React,{Component} from "react"; import {AutoComplete, message, Select,Spin} from "antd"; import $ from "jquery/src/ajax"; class AutoCompleteSearch extends Component{ constructor(props) { super(props); this.state={ contactsOption:[], autoCompleteSearchLoading:false } this.onSelect = this.onSelect.bind(this); this.onSearch = this.onSearch.bind(this); } onSelect(value){ this.props.onSelect(value) } onSearch(value){ this.setState({ autoCompleteSearchLoading: true }); let data = {}; data[this.props.config.search] = value $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + this.props.config.api, data, success: function (data) { let theArr = []; if (data.error && data.error.length === 0) { for(let i=0;i ( {group.label} )); return ( ) } } export default AutoCompleteSearch;