0
$('#save-board-assignees').click(function()
{
$('#board_assignee_table_wrapper input[type="checkbox"]:checked').each(function(i, td_e)
{
console.log('Found checked checkbox');
var assignee_id = 0;
var team_id = 0;
var assignee_holder = [];
assignee_id = $(this).closest('td').next().attr('id');
assignee_name = $(this).closest('td').next().html();
team_id = $(this).closest('td').next().next().attr('id');
console.log('Assignee name: ' + assignee_name);
console.log('Team id: ' + team_id);
console.log('Assignee id: ' + assignee_id);
assignee_holder.push(assignee_id, assignee_name);
board_assignees.push(assignee_holder);
});
}
此代碼僅被選中的頁面上選中的複選框的兄弟<td>
(受讓人的名稱,團隊ID,受讓人ID)的值。它不會在DataTable
的其他頁面中選中複選框。根據數據表中所有選中的複選框獲取同級td值?
這裏的表結構的示例代碼段: https://jsfiddle.net/30u4knrs/
@KScandrett將這個好起來? https://jsfiddle.net/30u4knrs/1/ – herondale
你在使用http://datatables.net/? –
@KScandrett是的是的 – herondale