Boostrap表:按行索引获取行数据

时间:2016-02-15 14:22:57

标签: javascript twitter-bootstrap bootstrap-table

Bootstrap Table ,一个字段有锚标记,所以点击时我可以得到父行的数据索引。现在我想使用数据索引

获取完整的行数据
  $(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等

1 个答案:

答案 0 :(得分: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);
   }
};

http://jsfiddle.net/wenyi/e3nk137y/39/

相关问题