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.13k stars 453 forks source link

getCellItem value returns "t2com.evrencoskun.tableviewsample2.ui.tableview.model.CellModel@99a0259" #386

Open luckylane opened 3 years ago

luckylane commented 3 years ago

Describe the bug I'm using "mTableView.getAdapter().getCellItem(0, row)" as per evrencoskun's comments try to get the value of the selected cell item on onCellLongPressed method but returns "t2com.evrencoskun.tableviewsample2.ui.tableview.model.CellModel@99a0259" instead of the cell value, could you some help with this issue? Really appreciated!

Tools:

alanjshort commented 2 years ago

I too am stymied by this bug. I have spent days and days trying to find work arounds - I can find no way to retrieve the value of a cell except for onCellClicked, which will return only the cell value that you click on, but if that's a non unique cell way down on a row, it's not much help. The workaround I adopted was to populate the row header with the same value as the first column, and make sure the first few columns contained unique values, Then, force the onCellClicked to always return column 0. This I then write into a database record and upon a timer, when the record gets populated, I search for the unique value. I populate this record in the same manner for a row header click. If the grid has been scrolled to the right, I get a different value, so On no-hit I check for the subsequent. etc. It works but it's a really ugly cludge. If ErvransCosKun would either fix his code, or provide a function to translate these CellModel@nnnnnnn records, we'd be in great shape, because ....getAdapter().getCellRowItems(row).toString(); returns exactly what we need - a comma delimited set of CellModel@nnnnnnn records pertaining to the entire row. How come I don't see others complaining about this? So the big question is: Is there a way to translate the CellModel@nnnnnnn values into meaningful data?