【问题标题】:Boostrap Table: get the row data by row indexBootstrap Table:通过行索引获取行数据
【发布时间】:2016-02-15 14:22:57
【问题描述】:

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 等

【问题讨论】:

  • 能否提供 HTML 标记?

标签: javascript twitter-bootstrap bootstrap-table


【解决方案1】:

点击即可获取表格的行、索引和数据。

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/

【讨论】:

    猜你喜欢
    • 2016-10-08
    • 1970-01-01
    • 2016-08-06
    • 2020-08-03
    • 2013-03-17
    • 2015-08-09
    • 2018-05-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多