bootstrap 父子表格,子表格ajax异步加载detailView

bootstrap 父子表格,子表格ajax异步加载detailView_第1张图片

//初始化子表格(无线循环)
initTable.InitSubTable = function(index, row, $detail) {
//var parentid = row.disIsbn;
$detail.html('

').find('table');
var html = "";
//
html += "";
html += "";
html += "";
html += "";
html += "";
html += "";
html += "";


$.ajax({
//StationAction
url : "/test/StationAction",
type : 'GET',
//url : "/WebOne/servlet/StationServlet",
dataType : "json",
success : function(data) {


html += '
    ';
    //遍历站点信息
    var values = eval(data);
    //遍历站点信息
    $.each(values, function(n, value) {
    //  alert(n+' '+value);  
    console.info('信息' + n + value);
    html += "
";
});
html += '
站点ID站点名称
" + value.stationId + ""
+ value.stationName + "
';
$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}]



你可能感兴趣的:(Java)