//初始化子表格(无线循环)
initTable.InitSubTable = function(index, row, $detail) {
//var parentid = row.disIsbn;
$detail.html('<table></table>').find('table');
var html = "";
//
html += "<table class='table'>";
html += "<thead>";
html += "<tr>";
html += "<th>站点ID</th>";
html += "<th>站点名称</th>";
html += "</tr>";
html += "</thead>";
$.ajax({
//StationAction
url : "/test/StationAction",
type : 'GET',
//url : "/WebOne/servlet/StationServlet",
dataType : "json",
success : function(data) {
html += '<ul class="list-group" >';
//遍历站点信息
var values = eval(data);
//遍历站点信息
$.each(values, function(n, value) {
// alert(n+' '+value);
console.info('信息' + n + value);
html += "<tr><td>" + value.stationId + "</td><td>"
+ value.stationName + "</td></tr>";
});
html += '</table>';
$detail.html(html);// 关键地方
}
});
};
===========
父表格设置:
detailView : true, //是否显示详情折叠
//注册加载子表的事件。注意下这里的三个参数!
onExpandRow : function(index, row, $detail) {
initTable.InitSubTable(index, row, $detail);
}
=======
后台数据格式,
[{"stationId":"CQ11","stationName":"重庆三峡店","stationClass":"2","stationParent":"CQ01","lastModDate":"Feb 3,
2016 2:13:55 PM","lastTransDate":"Jan 4, 2012 4:00:35 PM","localFlag":"0","stockArrearMethod":"1","jhStyle":"0","shortName":"21号
仓","isExists":"1","accountClient":"KCQ11JSKH0","accountFactory":"GCQ11JSHY0","inputFlag":"0","isAllowimport":"0",
"taxratebyproduct":"1","taxratebybusiness":0.0,"taxratebyscale":"1","tjBalancefDiscount":0.0}]