在 Bootstrap Table ,一个字段有 anchor 标记,因此单击时我可以获得父行的数据索引。现在我想使用 data-index
获取完整的行数据 $(document).on('click', '.delete_icon', function(event) {
var index = $(this).parent().parent().data('index');
//Get the complete row data by using the dataindex
// Row has three fields
});
我无法使用data-uniqueid来获取数据,因为我的唯一ID是像#1:1、#1:2等这样的字符串
最佳答案
点击即可获取表格的行、索引和数据。
window.actionEvents = {
'click .dele_icon': function (e, value, row, index) {
alert('You click remove icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
}
};
关于javascript - Bootstrap 表 : get the row data by row index,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35411822/