I'm using Datatables 1.10.7. I have a table initialized with Datatables like so:
var user_table = $("#user_table").DataTable({
"bInfo":false,
"bLengthChange":false
});
I've written code that triggers a series of events when someone clicks a row in that table like this:
$("#user_table tbody").on('click', 'tr', function () {
// Series of actions here
});
My #user_table has rows like this:
<tr data-user-id="4287">
<td>Jane Smith</td>
<td>Senior VP</td>
</tr>
<tr data-user-id="2442">
<td>John Doe</td>
<td>HR Manager</td>
</tr>
On page load, I want to trigger the click event on rows with the data-user-id matching a list of dynamically generated user-id's. For the sake of this question, how would I trigger the click event on the row with a data-user-id of 4287? Keep in mind, because of Datatables pagination, the row may not exist in the DOM - only in the Datatables variables - so I need a solution that utilizes the Datatables API.