Sorting column and using cell() function
Sorting column and using cell() function
I have a datatable with a sortable column. Clicking the header sorts it. So far so good.
However, after sorting, I then want to iterate the cells in the column. So I do this:
datatable.column(".latest").nodes().each(function (node, index, dt) {
var the_cell = this.cell(index, '.sto_bid').node();
}
However, this pulls back the cell before the column was sorted. In other words, index=0 is pulling back what is now the last cell in the column. How do you reset the indexes when you sort, so cell(1, '.sto_bid') will return the first cell shown in the table?