0
我有很好的datatables设置和选择扩展 - 我有这个代码当有人使用“报告”,它加载另一个页面使用表中的一些单元格内容传递给那个报告。这工作正常,但是 - 我需要能够通过该表,而不是行数据的每个<tr>
的data-element
...DataTables selected rows data-attribute
这是我当前的代码:
var table = $('#table_search_project').DataTable();
//then re-run the code to get the selected rows
var id_list = $.map(table.rows('.selected').data(), function (item) {
return item[1]
});
所以你可以看到,我曾经使用item[1]
返回,但我真的想能够获得<tr>
对象,所以我可以检索data-something-id
属性(但我不想显示它 - 因此问题)