获取DataTables中选中行的行值
我画了一个数据表,每行都有复选框。现在,当我选择某些复选框并单击“提交”时,我想获取整行中所有列的值。
我尝试使用 $('tr input',oTable.fnGetNodes()).serialize();
,但这仅返回复选框的值。 我怎样才能获得整个选中行的值。
I have painted a datatable with checkbox's against each row. Now when i select certain checkboxes and click submit , I want to get the value of all the columns in the entire row.
I tried using $('tr input',oTable.fnGetNodes()).serialize();
, but this returned only the value of the checkbox.
How can i get the value of the entire checked row.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决了问题。
循环遍历数据表中的每个
tr
行,并使用rowData 获取包含每个单元格值的数组。rowData 是一个包含每个单元格值的数组。因为复选框是第一列,从 rowData 数组中获取第一列的值,如下所示
Resolved the issue.
Looped over each of the
tr
rows in the Datatables, and got the an array containing value of each cell usingrowData is an array which contains the values of each of the cells.Since the checkbox was the first column , got the value of the first column from the rowData array like this