我是新來做的反應,以及用戶界面,我想從我的ajax調用服務器收到的JSON響應創建一個漂亮的表。我怎樣才能做到這一點。在reactJS中創建一個來自json響應的動態表
任何形式的信息都會非常有幫助。
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. //
}
我的回答是這樣的{ '名': '迪夫亞', 'ID': '1', '任務': '某某'}
感謝。