我用 ajax 获取到数据
//pos数据库
function PosData(url,Data) {
var tData;
$.ajax({
type: "post",
url: url,
data: Data,
async: false,
success: function (result) {
tData= result;
}
});
return tData;
}
var json = PosData(url,data);
//alert(json); //读取到字符串是: [{"ID":1,"项目名称":"好的","表名称":"111","字段名称":"111","记录值":"111","备注":"11"},{"ID":2,"项目名称":"dd","表名称":"56","字段名称":"777","记录值":"45","备注":"66"},{"ID":3,"项目名称":"111","表名称":"在线升级","字段名称":null,"记录值":"旧","备注":null}]
//现在我直接:
activeSheet.autoGenerateColumns = true;
activeSheet.setDataSource(json);
但是不成功,
要这么做呢?
|