wenzhixin Bootstrap-Table nested tables/sub-table -
i trying make existing bootstrap table neasted detail-views, have regular detailview add 1 layer on top of detailed view... first list taken database, when expanding + sign, 2 options , have expansion well.. below first option on second layer detailed view , second 1 should have table taken database. not getting work, have been using https://github.com/wenzhixin/bootstrap-table-examples/blob/master/options/sub-table.html base not getting detailformatting recive items (rows) on second layer of table, top layer. second table possible add , existing table sub-table?
this .js code
# ` $('#table').bootstraptable( {detailview: true, onexpandrow: function (index, row, $details) { expandtable1(index, row, $details); } }); function detailformatter1(index, row) {
var input = ({ "title": row.title, "document id": row.hvcdocumentid, "part id": row.hvcdocumentpartid, "revision": row.hvcrevision, "revsion text": row.hvcrevisiontext, "summery": row.hvcsummary, "document kind": row.hvcdocumentkind, "replaces": row.hvcorigin }) var html = []; $.each(input, function (key, value) { html.push('<p><b>' + key + ':</b> ' + value + '</p>'); }); return html.join(''); } var $table = $('#table'); $(function () { buildtable($table); }); function expandtable1(index, row, $detail) {
buildtable($detail.html('view details').find('table'), row, index); } function buildtable($el, row, index) {
$el.bootstraptable({ detailview: true, detailformatter: detailformatter1, onexpandrow: function(index, row, $detail) { detailformatter1(index, row); } }); }
`
table code in html:
<table id="table" data-toggle="table" data-url="getpathdocuments" data-query-params="queryparams" data-search="true" data-search-on-enter-key="false" data-smart-display="true" data-trim-on-search="false" data-cache="false" data-pagination="true" data-page-number="1" data-page-size="50" data-page-list="[25, 50, 100, 250, 500]" data-side-pagination="client" data-id-field="hvcdocumentid" data-show-refresh="false" data-detail-view="true"
Comments
Post a Comment