I have the following semantic-ui-react Table on jsx page
<Table id='myTable' celled selectable sortable headerRow={['Id', 'Name']} renderBodyRow={this.renderBody} tableData={list} />
I need to put this table to html string in calling method
getHtmlTable() {
var html = document.getElementById('myTable');
$.ajax({
type: "POST",
url: "http://localhost:50000/api/table/",
data: html,
beforeSend: function() {
},
success:function() {
}
});
}
And get it in the post method:
[HttpPost("html")]
public void GetData(string html)
{
}
How can i get the table in html format? I found a .html() funciton in jQuery, but can't understand how to use it. I tried so:
<div className="htmlData">
<Table id='myTable' celled selectable sortable headerRow={['Id', 'Name']} renderBodyRow={this.renderBody} tableData={list} />
</div>
getHtmlTable() {
var html = $('htmlData').html();
$.ajax({
type: "POST",
url: "http://localhost:50000/api/table/",
data: html,
beforeSend: function() {
},
success:function() {
}
});
}
But it doesn't work. Can anybody help?