javascript - Bootstrap 表 : get the row data by row index

标签 javascript twitter-bootstrap bootstrap-table

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);
   }
};

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

关于javascript - Bootstrap 表 : get the row data by row index,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35411822/

相关文章:

javascript - 引导表自定义搜索

javascript - 从前端到后端签署 api 调用

javascript - 如何从 JQUERY 中的 HTML 文档获取 XML 对象

jquery - DataTables 固定列透明与 Bootstrap 4 strip 表

html - Bootstrap 折叠标题在第一次点击时闪烁

javascript - 如何使 th 的宽度等于另一个 bootstrap-table 中的每个对应的 th

javascript - BootstrapTable 不支持分页

javascript - 从部分 View 的 javascript 函数调用父 View 的 javascript 函数

javascript - 使悬停和其他 CSS 细节上的图片变暗

html - 全高 - Web 响应 - Twitter Bootstrap