Ich bin neu zu reagieren sowie UI und ich möchte eine schöne Tabelle aus der JSON-Antwort von meinem AJAX-Aufruf an den Server erhalten. Wie kann ich das machen.Erstellen einer dynamischen Tabelle von JSON Antwort in reactJS
Jede Art von Informationen wäre wirklich hilfreich.
var Contact = React.createClass({
getInitialState: function(){
return {}
},
submit: function (e){
var self
e.preventDefault()
self = this
console.log(this.state);
var data = {
Id: this.state.name,
User: this.state.email,
}
$.ajax({
type: 'POST',
dataType: 'json',
url: 'http://localhost:8080/ui/start',
data: JSON.stringify({
Id: this.state.name,
User: this.state.email,
})
})
.done(function(response) {
console.log(response);
// This is where I have the JSON response .How can I create a dynamic table from this response **strong text**and render in on UI. //
}
Meine Antwort sieht wie folgt aus { 'name': 'divya', 'id': '1', 'Aufgabe': 'xyz'}
Dank.