var table; window.LexiconFormResult = React.createClass({ componentDidMount: function() { table = $('#lexicon-results').DataTable({ data: [], columns: [ { title: "Surface form" }, { title: "Tag" }, { title: "Lemma" } ] }); }, componentWillReceiveProps: function(nextProps) { if (nextProps.result == undefined) { return; } if (this.props.result && nextProps.result.hash == this.props.result.hash) { return; } table.rows().remove(); if (nextProps.result.data.length > 0) { table.rows.add(nextProps.result.data); } table.draw(); }, render: function() { if (this.props.error != null) { return