【发布时间】:2015-07-31 22:03:26
【问题描述】:
我有一个基于 javascript 的 bootstrapTable,可以动态生成表格和数据。
我在尝试将一些 CSS 样式和类应用于 this question 中生成的一些 td 时遇到问题。我意识到我认为我的问题是表没有完全加载,这导致我的代码无法工作。如果我手动编写表格代码,它可以正常工作,但不是动态的。
我尝试使用 load 事件等待表加载,但这似乎不起作用
$table.load(function() {
// do something
});
我需要什么 jquery 才能等待 $table 在我做某事之前完全加载?
javascript 表格
var $table = $('#table-javascript').bootstrapTable({
method: 'get',
url: 'bootstrap_database.php',
height: 3849,
cache: false,
striped: true,
pagination: true,
search: true,
pageSize: 100,
pageList: [100, 200, 600, 1000],
minimumCountColumns: 2,
clickToSelect: true,
columns: [{
field: 'ID',
title: 'ID',
align: 'center',
visible: false
},{
field: 'backlink',
title: 'Backlink',
align: 'left',
width: '20'
},{
field: 'indexed',
title: 'PI',
align: 'center',
width: '20',
},{
field: 'dindexed',
title: 'DI',
align: 'center',
width: '20',
},{
field: 'moz',
title: 'MOZ',
align: 'center',
width: '20',
},{
field: 'email',
title: 'EM',
align: 'center',
width: '20'
},{
field: 'social',
title: 'SOC+',
align: 'center',
width: '20'
},{
field: 'whois',
title: 'WHO',
align: 'center',
width: '20'
},{
field: 'notes',
title: 'NT',
align: 'center',
width: '20'
},{
field: 'removed',
title: 'RM',
align: 'center',
width: '20'
},{
field: 'import_label',
title: 'SR',
align: 'center',
width: '20'
},{
field: 'important',
title: 'IM',
align: 'center',
width: '20'
},{
field: 'refresh',
title: 'RF',
align: 'center',
width: '20',
class: 'refreshstats'
},{
field: 'exempt',
title: 'EX',
align: 'center',
width: '20',
},{
field: 'spammy',
title: 'SP',
align: 'center',
width: '20',
}]
});
【问题讨论】:
-
你看过文档吗?
-
我有,除非你看到什么,否则我什么都找不到。
-
天啊,在我写完我的评论后,我发现它大声笑
$table.on('load-success.bs.table', function () {
标签: jquery