我们正在使用谷歌表格图表,在$("#loginsubmit")
函数中我循环 awebservice
以获取id
和。现在我想在函数中的[one row for each ] 中添加所有值。我该怎么办?任何帮助都将不胜感激。firstName
lastName
DataTable
id
drawTable
$("#loginsubmit").live("click", function () {
for (var i = 58; i < 63; i++) {
var request = new Request();
request.service = "http://88.80.223.163:8080/lumiin-service/lumiin/control/communication/" + i;
RequestHandler(request, drawTable);
}
});
function drawTable(data) {
//alert(JSON.stringify(data.contents.id) + 'Eshan');
var datat = new google.visualization.DataTable();
//alert(a);
datat.addColumn('string', 'Id');
datat.addColumn('string', 'First Name');
datat.addColumn('string', 'Last Name');
datat.addColumn('string', 'Place');
//alert(data.contents.id + 'Eshan1');
datat.addRows([
[JSON.stringify(data.contents.id), JSON.stringify(data.contents.prospectId.firstName), JSON.stringify(data.contents.prospectId.lastName), JSON.stringify(data.contents.place)], ]);
var table = new google.visualization.Table(document.getElementById('table_div'));
table.draw(datat, {
showRowNumber: true
});
}