Coder Social home page Coder Social logo

Comments (13)

PewPewKenshin avatar PewPewKenshin commented on July 17, 2024 4

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.

ISchwarz23 avatar ISchwarz23 commented on July 17, 2024

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.

Pecto2000 avatar Pecto2000 commented on July 17, 2024

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.

giova-fr avatar giova-fr commented on July 17, 2024

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.

ISchwarz23 avatar ISchwarz23 commented on July 17, 2024

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.

Reagang avatar Reagang commented on July 17, 2024

Hi!
How to highlight a selected row please?

from sortabletableview.

ISchwarz23 avatar ISchwarz23 commented on July 17, 2024

Hi,
I'm currently looking for a solution for the selection, but I have some problems.

from sortabletableview.

ulaserdegor avatar ulaserdegor commented on July 17, 2024

Hi,
Still no solution for selector ?

from sortabletableview.

ISchwarz23 avatar ISchwarz23 commented on July 17, 2024

No, it is not as easy to achive as expected.

from sortabletableview.

ISchwarz23 avatar ISchwarz23 commented on July 17, 2024

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.

ISchwarz23 avatar ISchwarz23 commented on July 17, 2024

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.

omkarghurye1998 avatar omkarghurye1998 commented on July 17, 2024

Hi,
I'm currently looking for a solution for the selection, but I have some problems.

try your best sir

from sortabletableview.

Fdde11 avatar Fdde11 commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.