I'm using Bootstrap table (http://wenzhixin.net.cn/p/bootstrap-table/docs/index.html)
I'm trying to add click event
$('tr').click(function(){ console.log('test'); });
but it doesn't work. I know that there is event in bootstrap-table library, but it's important for me to use it exactly with jQuery's .click. Do you know what is blocking this event in bootstrap-table source code? I tryied to remove all ".off"s from bootstrap-table.js, but it didn't help.
I think you can use the onClickRow
or click-row.bs.table
event instead of the tr click event, here is the documentation and examples.
Code example:
// Fires when user click a row
$('#table').bootstrapTable({
onClickRow: function (row, $element) {
// row: the record corresponding to the clicked row,
// $element: the tr element.
}
});
// or
$('#table').on('click-row.bs.table', function (e, row, $element) {
// console.log(row, $element);
});
(I am the author of Bootstrap Table, hope to help you!)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With