Comments (13)
Until the owner officially implements highlighting of the selected item, here is a workaround...
assuming you already have your own way of storing the rowData on orientation change (similar to setRetainInstance(true) in fragments)
then to change the background color of the row you call yourSortableTableView.getDataAdapter().getView(rowIndex, convertView, parentViewGroup).setBackgroundColor(yourColor) and after that you MUST call yourSortableTableView.getDataAdapter().notifyDataSetChanged().
a sample updateTable function
Edit: okay I found out that changing background on one even or odd row will change the background for all odd/even rows
Edit2: ok I managed to get highlighting working, but instead of setting background color to whole row, I had to set the background color of each cellView in the row
from sortabletableview.
Hi @Pecto2000,
in deed this is a feature that has not been implemented. When the user clicks on an item, this item is selected. But when the table is filtered, the selection will stay at the index and will not move as the selected item. Another issue is, that the selection is lost on orientation change.
Thanks for the hint. This is a feature that will come in a future release, but unfortunatelly I am not able to tell you, when this will be. You are welcome to create a pull request containing this feature ;)
Best regards,
Ingo
from sortabletableview.
Thank you for your reply. I will try to deal with this topic.
- Is there a way to retrieve a specific row [getRowView(rowIndex, ...)] in the tableView (as getCellView)?
- Is there a way to retrieve the rows number [rowCount] in the tableView (as columnCount) ?
- Is there a way to retrieve list of Rows
My immediate goal is to get a specific row (+ all rows ) in the tableView and do a foreach on this list.
from sortabletableview.
Thank you for this very nice View !
i'm also very interrested by this feature :)
also a get_RowSelected() would be nice to play with it.
from sortabletableview.
Hi @Pecto2000,
Reply to 1)
The TableDataAdapter
is able to give you the complete row view by calling the getView()
method.
Reply to 2)
Again the TableDataAdapter
is able to give the number of rows by calling the getCount()
method.
Reply to 3)
Do you need to have all rows or all row data? You can get all the row data by calling TableDataAdapter#getData()
.
from sortabletableview.
Hi!
How to highlight a selected row please?
from sortabletableview.
Hi,
I'm currently looking for a solution for the selection, but I have some problems.
from sortabletableview.
Hi,
Still no solution for selector ?
from sortabletableview.
No, it is not as easy to achive as expected.
from sortabletableview.
Hi @PewPewKenshin,
you can also implement a new TableDataRowBackgroundProvider
that checks, if the data item is selected and returns the desired color. I think think that this is more easy than set the background color for every single cell in a row.
Best regards,
Ingo
from sortabletableview.
Hi @Pecto2000 ,
unfortunately selection is not supported by this library. But there is a new generation of this library available at sortabletableview.com, which support the selection feature and much more new features. This new library is based on the recycler view, so it uses up to date technology which enables better performance.
Best regards,
Ingo
from sortabletableview.
Hi,
I'm currently looking for a solution for the selection, but I have some problems.
try your best sir
from sortabletableview.
Hi @PewPewKenshin,
you can also implement a new
TableDataRowBackgroundProvider
that checks, if the data item is selected and returns the desired color. I think think that this is more easy than set the background color for every single cell in a row.Best regards,
Ingo
Is there a way to implement the custom TableDataRowBackgroundProvider without having to re-populate the table again? I tried calling my custom TableDataRowBackgroundProvider inside my addDataClickListener but I have to "refresh" the table in order for the changes to be visible.
from sortabletableview.
Related Issues (20)
- Apply sorting on date column: HOT 8
- table responsiveness HOT 3
- How do I get the cell content? HOT 1
- "Mark" selected row without using a custom TableView Adapter? HOT 2
- where use simpletabledataadapter#setTextsize HOT 3
- Horizontal Scroll and Vertical Scroll HOT 2
- CheckBox to TableHeaderAdapter HOT 1
- Text alignment in the SortableTableView HOT 1
- Implement custom TableDataRowBackgroundProvider without re-populate table HOT 2
- Table Scrolling HOT 2
- Add footer view HOT 4
- Part of row's background gets white after long click
- inflating class de.codecrafters.tableview.TableView HOT 1
- Merge cells in a row HOT 1
- SortTableView scroll problem
- I want just find solution this. onclickData problem. - read one single cell value. If you can tell tips HOT 3
- Records are not showing using Kotlin
- reference Tableview is null
- onDataClickListener and onDataLongClickListener HOT 2
- Getting Duplicate class found error after adding this dependency HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sortabletableview.