GithubHelp home page GithubHelp logo

Comments (6)

ISchwarz23 avatar ISchwarz23 commented on June 20, 2024

Hi Thomas,

Thanks for the nice words. Could you please state which method you are using for the "default" sorting column?

Best regards,
Ingo

from sortabletableview.

thomasdsouza avatar thomasdsouza commented on June 20, 2024

Hi Ingo, I could use SortableTableView.sort() but really even if i didn't specifically call any sort method, I would still prefer the view to show which column is sorted to start off with (i.e. default if you did nothing but just followed the sample setup). Thanks much!

from sortabletableview.

ISchwarz23 avatar ISchwarz23 commented on June 20, 2024

If you do not call the method void sort(final int columnIndex) or void sort(final int columnIndex, final boolean sortUp) or void sort(final Comparator<T> comparator) it is not sorted at all. It is simply using the order of the given data. This is the reason why no sorting indicator is shown.
If you want to have the same "default" sorting for a certain table in your app, I recommend using the method void sort(final int columnIndex, final boolean sortUp).

from sortabletableview.

thomasdsouza avatar thomasdsouza commented on June 20, 2024

Hi Ingo, thanks for your response. Even if i sort by calling any of the sort( ) functions, data is being sorted but indicator is not being shown.

from sortabletableview.

ISchwarz23 avatar ISchwarz23 commented on June 20, 2024

I can't confirm that. I experienced the expected behaviour which is:

  • sort(Comparator<T> comparator) -> sorts the column using the given comparator and will not display any indicator (as the given comparator does not need to belong to a certain column)
  • sort(int index) -> sorts the column ascending using the comparator set for the column with the given index. A second call to this method with the same column index will sort the table descending using the comparator set for the column with the given index. (behaves like a click on the column header)
  • sort(int index, boolean sortUp) -> sorts the table ascending or descending depending on the sortUp param using the comparator set for the column with the given index (suitable for creating a programatic "default" sorting)

I have tested this with the currently latest version (2.0.1)

from sortabletableview.

thomasdsouza avatar thomasdsouza commented on June 20, 2024

Thank you again for your response. You have helped me figure out the issue. The bug was that i was setting the adapter again (in my case in onLoadFinished() ) and so i needed to call sort(int index) twice again.

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.