var $table = $('#table');
$table.on('expand-row.bs.table', function (e, index, row, $detail) {
$detail.html('Carregando os dados...');
});
我想捕获除点击的行以外的所有行,然后关闭它们。
答案 0 :(得分:0)
我认为expand-row
是一个班级...
我还假设您行的实际display
值为table-row
...
但它也可能是inline
。
试试这个:
var $table = $('#table');
$table.on("click", '.expand-row.bs.table', function (e, index, row, $detail) {
$('.expand-row.bs.table').each(function(){ // iterates all rows.
$(this).css({"display":"none"}); // Here, "this" is row element.
});
$(this).css({"display":"table-row"}); // Here, "this" is the clicked element.
$detail.html('Loading data ...');
});