B4J Question Sort TableView with objects

Radisk3

Member
Licensed User
Longtime User
Hi,

I create my TableView with objects, according to the attached image.
Is there any way to sort through the second column?
 

Attachments

  • Captura de tela_2019-08-02_09-05-16.png
    44.7 KB · Views: 397

Radisk3

Member
Licensed User
Longtime User
This might do the job until a better answer arrives:

View attachment 82762

Hello!

Thank you for your answer.
I have tried the classification methods of the component, but without success.
Understandable for being a grid of objects.
I've thought of several ways to do it.
For example:
- Create a list, classify the list and fill the object grid with the classified list.
- Create a tableview with the data, sort and then create tableview of objects with the classified grid.
- Create a Tableview reading routine of objects to click on a tableview or listview variable, sort and recharge the tableview of objects.
- ...
In all these cases and others that I thought, I will always have to have an auxiliary table variable to classify when the user triggers the column title and recharges the grid.
Since the grid is editable, it has to be more dynamic.

So, if someone has already developed something similar or suggested another editable grid that accepts objects, such as buttons, it's viable.
 

Attachments

  • Captura de tela_2019-08-02_09-46-59.png
    35.9 KB · Views: 234
Upvote 0

emexes

Expert
Licensed User
Understandable for being a grid of objects.
What are the objects?
How does one sort buttons? By label text? By size? By X and then Y coordinates?
Is each column a specific type, or does it vary from row to row?

Given that TableView.Items is a regular List (of one array per TableView row) then it can probably be sorted in-place (sort of) (pun not intended)

How many rows in table?
 
Upvote 0

Radisk3

Member
Licensed User
Longtime User
Hey, guys!

All right... the number of columns and rows is dynamic. It depends on the source data that are also variable.
Therefore, the columns end up having different data types such as number, characters, dates.
As for objects, at most I will need to place buttons and options.

But Erel came up with an interesting idea... B4XTable.
Since I am dealing with older projects, I had not realized the use of B4XTable for some processes and looking at the examples in the forum, I think I can adapt.
I'll work on it today and check the results.
Once finished, I will post the result here.

Thank you emexes and Erel.
 
Upvote 0

emexes

Expert
Licensed User
Therefore, the columns end up having different data types such as number, characters, dates.
If those different types are within the one column, then I'm looking forward to seeing how you implement that. I can sort a list in-place on multiple columns, eg, by postcode, then age, then surname, but it relies on each column being just one field and type.
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…