Detect click on specific column
Detect click on specific column
Igorski88
Posts: 25Questions: 8Answers: 0
oI am doing a favorets flag column and when a click is detected I would like the Row to be saved as a faverited Item. I am using a solid star for the "favorited" row. When I click on the star I want to Un -avorite the row. Currently,
I am using the following:
$('#ResultsTable tbody').on('click', 'tr td:eq(0)', function () {
var table = $('#ResultsTable').DataTable();
MarkItemsAsFavorite(table.row(this).id());
});
The problem: This only works on the first Row.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I think the problem is you jQuery selector of
td:eq(0)
only applies to the first cell in the table. You will want something liketd:first-child
to get the first cell of each row.Kevin
How did I overlook that!! Thanks for your help