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

Cell view type with hidding columns #275

Open S1LL opened 4 years ago

S1LL commented 4 years ago

Hi, I am still learning with this amazing library and I have a question.

I have a two column cell types (similar like in a demo). For example one type is on first and third column and second type is second and fourth column. When I hide the second column the columns shifts, but not the cell types. I have still the same cell types, because the getCellItemViewType method still returns the same indexes (the third column is now second, but method returns previous type).

I have solved it programatically by checking which columns are hidden, but its not very elegant solution. Is there some other way?

Thanks

Parlae commented 4 years ago

I am also having this issue. @S1LL can you share your solution? Thanks

S1LL commented 4 years ago

@Parlae Hey, my use case is kinda simple, I have second type only on 2nd and 3rd column, so Im checking in ViewModel which columns (1st to 3rd) are hidden and according to this Im changing the index. But I dont really like this solution, it would be kinda impossible for very complicated table. Also this solution is not 100% yet because of the second bug, which should be solved in the next release. But in theory this should work.

If the library somehow remebered column indexes, that would be ideal.

evrencoskun commented 4 years ago

Hi guys @Parlae, @S1LL

As soon as I got an opportunity, I will try to fix this problem. Probably I need to change the selection logic of the Tableview.

Parlae commented 4 years ago

Thank you @S1LL for your reply, and thank you @evrencoskun for your efforts

samanta-widjaja commented 2 years ago

I also have this problem. Please fix it asap