evrencoskun / TableView

TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
MIT License
3.14k stars 459 forks source link

Sorting changes the cell text but leaves the cell id? #319

Open indieshack opened 4 years ago

indieshack commented 4 years ago

OK, I think the bigger issue here is getting a reference to a cell after (for example) column sorting

Cell aCell1 = (Cell) mTableView.getAdapter().getCellItem(0, row);

The above in the onCellClicked method in TableViewListener returns the correct cell in a freshly loaded table. It's not correct after a sort and the table rows rearranged. Any solutions?

indieshack commented 4 years ago

Bit more information - it appears that if you filter table data and then attempt to get the value of a cell using below, it returns the value of the unfiltered data set row. mTableView.getAdapter().getCellItem(0, mTableView.getSelectedRow())).getContent()