Update row/cell not currently visible
Update row/cell not currently visible
Hi, I'm trying to update a cell in a DataTable that's on a different "page", using version 1.10. Since it's not visible to the DOM I can't manipulate it with jQuery selectors.
The table is initialized on existing HTML markup, where the rows look like this:
<tr data-id="1">
<td><label><input type="checkbox" name="part[]" value="1"></label></td>
<td>(Description)</td>
<td>(Price)</td>
<td>(Quantity)</td>
</tr>
More specifically, I'd like to un-check the checkbox, targeting the table row by the data-id attribute I added.
From reading documentation it looks like the .data() api can help with this, but how do I select by my data-id attribute and then change the HTML of that first table cell?
Thanks for your time.
Answers
A solution would be to add a hidden column that would hold the
data-idfor you. You would then be able to find that row without needing it rendered.Thanks for the response, Daimian. I don't think I follow, how would I be able to find and manipulate a row's cell contents using a hidden column?
Look here: http://datatables.net/forums/discussion/6629/get-value-of-row-on-another-page
Thanks kasey, but that appears to be for the previous version of DataTables.
I ended up resolving this issue by queueing the IDs not present on the current page in an array for later, then checking for them each time the
drawevent was fired.