Bootstrap Table: 通过行索引获取行数据
Boostrap Table: get the row data by row index
在Bootstrap Table
,一个字段有锚标记,所以点击时我可以获得父行的数据索引。现在我想使用 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 等
点击即可获取table的行、索引、数据
window.actionEvents = {
'click .dele_icon': function (e, value, row, index) {
alert('You click remove icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
}
};
在Bootstrap Table ,一个字段有锚标记,所以点击时我可以获得父行的数据索引。现在我想使用 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 等
点击即可获取table的行、索引、数据
window.actionEvents = {
'click .dele_icon': function (e, value, row, index) {
alert('You click remove icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
}
};