Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onCellClicked returns correct cellView but incorrect row after sorting #396

Open
alanjshort opened this issue Nov 14, 2021 · 4 comments
Open
Labels

Comments

@alanjshort
Copy link

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Stacktrace
If applicable, add the stacktrace you encountered.

Tools:

  • TableView version: [e.g. 0.8.9.2]
  • Android version: [e.g. 11]

Additional context
Add any other context about the problem here.

@alanjshort alanjshort added the bug label Nov 14, 2021
@alanjshort
Copy link
Author

If a grid has a small number of rows, this bug is present. If the number of rows is larger, the bug disappears. Not sure exact number of records to make bug disappear (but it's more than the visible grid).

If you sort a grid on any column, following the sort, click on a cell, the onCellClicked event returns correct cell view, but the row returned is the unsorted row number. This means that if you highlight based upon the returned row using setSelectedRow(row), the wrong row is highlighted, though the correct cell data has been returned.

public void onCellClicked(@nonnull RecyclerView.ViewHolder cellView, int column, int row) {
try {
mTableView.getSelectionHandler().clearSelection();
String strData = "";
if(cellView instanceof CellViewHolder){
strData = (String) ((CellViewHolder)cellView).cell_textview.getText();
}
mTableView.setSelectedRow(row);

          // processing of strData 

    } catch (Exception e) {
            e.printStackTrace();
    }

Tableview Version '0.8.9.4'
Android Version 9

@samanta-widjaja
Copy link

this happen when i filter the table too.

@alanjshort
Copy link
Author

alanjshort commented Nov 23, 2021 via email

@alanjshort
Copy link
Author

alanjshort commented Nov 23, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants