Таблица живого поиска - PullRequest
0 голосов
/ 27 мая 2020
• 1000 между ними). ​​

Мой вопрос: с текущим кодом, как я могу добавить эту радиогруппу в строку Preference

enter image description here

    const columns = [
    {
        title: 'Email',
        dataIndex: 'email',
        key: 'email',
    },
    {
        title: 'Private email',
        dataIndex: 'privateEmail',
        key: 'privateEmail',
    },
    {
        title: 'Preference',
        dataIndex: 'isOnlineSystem',
        key: 'isOnlineSystem'
    },
];

class SearchInput extends React.Component {

    constructor(props) {
        super(props);

        this.state = {
            query: '',
            results: [],
            loading: false,
            message: ''
        };
    }

    fetchSearchResults = (e) => {
        getUserPreference(e)
            .then(res => this.setState({results: res.data}))
            .catch(error => {
                this.setState({loading: false, message: 'Failed to fetch the data'})
            });
    };


    onHandleInputChange = (e) => {
        const query = e.target.value;
        this.setState({query, loading: true, message: ''}, () => {
            this.fetchSearchResults(query);
        });
    };


    render() {
        const {query} = this.state;
        return (
            <div className="container">
                <h2 className="heading">Live User Search</h2>
                <label htmlFor={'search-input'}>
                    <Search
                        id='search-input'
                        value={query}
                        style={{width: '100%', height: '40px'}}
                        placeholder={'Search....'}
                        onChange={this.onHandleInputChange}
                    />
                </label>
                <div style={{marginTop:'15px'}}><Table
                    columns={columns}
                    dataSource={this.state.results}

                />
                </div>
                    </div>
        );
    }
}

export default SearchInput;
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...