Skip to content

Commit 3bd21e7

Browse files
feiazifeiazi王飞
andauthored
修改bootstrap-table生成的详情+号td标签样式 (#2604)
Co-authored-by: 王飞 <[email protected]>
1 parent f253d0a commit 3bd21e7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

sql/templates/sqlquery.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,8 @@ <h4 class="modal-title text-danger">收藏语句</h4>
807807
isdetail = true
808808
}
809809
var showExport = {{can_download}}===1
810-
$(`#query_result${n}`).bootstrapTable('destroy').bootstrapTable({
810+
var query_result_id=(`query_result${n}`);
811+
$(`#${query_result_id}`).bootstrapTable('destroy').bootstrapTable({
811812
escape: true,
812813
data: result['rows'],
813814
columns: columns,
@@ -870,6 +871,15 @@ <h4 class="modal-title text-danger">收藏语句</h4>
870871
});
871872
return html.join('');
872873
},
874+
onPostBody: function(data) {
875+
//此处的属性及样式名称,来自于bootstrap-table.js
876+
//有detail的表头,添加sytle
877+
var thHasDetail=$(`#${query_result_id} th.detail`);
878+
thHasDetail.css('white-space', 'nowrap');
879+
//有详情+号的的td,添加sytle。
880+
var tdHasDetail=$(`#${query_resultId} tr[data-has-detail-view="true"] .detail-icon`).parent('td');
881+
tdHasDetail.css('white-space', 'nowrap');
882+
},
873883
locale: 'zh-CN',
874884
onExportSaved: function (e) {
875885
var tabs = $("#nav-tabs li")

0 commit comments

Comments
 (0)