B4J Question [ABMaterial] ABMTable sort issue

Drago Bratko

Active Member
Licensed User
Longtime User
I fill table with records, and date is in format "yyyy.MM.dd" for easier string sorting.

B4X:
    Dim table As ABMTable
    table.Initialize(page, "table", True, False, True, "tbltheme")
    table.SetHeaders(Array As String("Date"))
    table.SetColumnSortable(Array As Boolean(True))
    for each ...
        Dim row As List
        row.Initialize
        row.Add(DateTime.Date(v.SomeDate))
        table.AddRow(ID, row)
    Next
    page.Cell(1, 1).AddComponent(table)
    table.Refresh

After I click to sort in at runtime, sorting in table is like this (order is not correct) :
SortingWrong2.jpg


Any idea what I'm doing wrong?
 
Last edited:

Harris

Expert
Licensed User
Longtime User
table.SetColumnDataFields
Take a look at this method for more sorting info.... It is a bit more complicated than one would expect initially..
Also look at the Demo program included in ABM for more clues.
 
Upvote 0

Drago Bratko

Active Member
Licensed User
Longtime User
Thank you for the clue ... I see the point.
If anyone else would came to the problem of sorting ... check "ABMFeedback" application.
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
Thank you for the clue ... I see the point.
If anyone else would came to the problem of sorting ... check "ABMFeedback" application.
Or you could post the code solution here as a short block...
Thanks
 
Upvote 0
Top