admin管理员组文章数量:1025244
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
1 Answer
Reset to default 3you 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/
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
1 Answer
Reset to default 3you 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/
本文标签: javascriptBoostrap Table get the row data by row indexStack Overflow
版权声明:本文标题:javascript - Boostrap Table: get the row data by row index - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745611873a2159047.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论