react and load datawith ajax

react and load datawith ajax

ofirk12ofirk12 Posts: 15Questions: 8Answers: 1
edited September 2016 in Free community support

Hello i create datatable with react :

   componentDidMount() {
         $(ReactDOM.findDOMNode(this.example))
            .addClass('nowrap')
            .dataTable({
                responsive: true,
                columnDefs: [
                    { targets: '_all', className: 'dt-body-left' }
                ]
            });
    }

render(){
return (
            <Table ref={(c) => this.example = c} className='display table table-bordered' cellSpacing='0' width='100%' striped bordered id='user'>
                <thead>
                <tr>
                    <th>Title</th>
                    <th>Name</th>
                </tr>
                </thead>
                <tfoot>
                <tr>
                    <th>Title</th>
                    <th>Name</th>
                </tr>
                </tfoot>
                <tbody>

                </tbody>
            </Table>
        );
    }

and its work but how i update the data with ajax , i call to ajax and create state that get the data after this element be render , but i cant to add the data.. some one have any idea?

This discussion has been closed.