javascript - Boostrap Table: get the row data by row index - Stack Overflow

In Bootstrap Table, one field has anchor tag, so when clicked i can get the data-index of parent row.

In Bootstrap Table , one field has anchor tag, so when clicked i can get the data-index of parent row. Now i want to get the plete row data using the data-index

  $(document).on('click', '.delete_icon', function(event) {
    var index = $(this).parent().parent().data('index');
    //Get the plete row data by using the dataindex
    // Row has three fields

  });

I cannot use data-uniqueid to get the data since my unique id is String like #1:1, #1:2 etc

In Bootstrap Table , one field has anchor tag, so when clicked i can get the data-index of parent row. Now i want to get the plete row data using the data-index

  $(document).on('click', '.delete_icon', function(event) {
    var index = $(this).parent().parent().data('index');
    //Get the plete row data by using the dataindex
    // Row has three fields

  });

I cannot use data-uniqueid to get the data since my unique id is String like #1:1, #1:2 etc

Share Improve this question asked Feb 15, 2016 at 14:22 mondamonda 3,91516 gold badges61 silver badges85 bronze badges 1
  • could you provide HTML markup? – johannesMatevosyan Commented Feb 15, 2016 at 14:38
Add a ment  | 

1 Answer 1

Reset to default 3

you can obtain the row, index and data of the table with a click.

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/wenyi/e3nk137y/39/

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745611875a4635992.html

相关推荐

  • javascript - Boostrap Table: get the row data by row index - Stack Overflow

    In Bootstrap Table, one field has anchor tag, so when clicked i can get the data-index of parent row.

    11小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信