我无法在我的 html 页面中访问 _sValues,但是我可以在控制台中 console.log 感兴趣的 _sValues 数组元素。
JSON
[
{
"_this":{
"_isEvent":false,
"_sNames":[
"name",
"tag",
"notes",
"input",
"type",
"action"
],
"_sValues":[
"Testing01",
"#13",
"1504013826",
"No details",
"cType",
"NA"
],
"_cName":"namesList",
"_dName":"TEST",
"_id":"12345",
}
}
]
HTML
<th class="col-md-5 col-xs-5" data-field="_this._sValues[1]" data-sortable="true">S-VALUES</th>
我希望看到页面上显示#13,而不是我没有看到任何值或控制台错误。但是我可以通过这样做来显示所有值_this.sValues
脚本
var data;
$(function () {
$.getJSON("http://localhost:8080/services/webapi/getAllData", function(json){
data = json;
$('#table').bootstrapTable({
data: data
});
});
});
开发工具
data[0]._this._sValues[1]
"#13"