B4A Library [Class] Flexible Table

Inman

Well-Known Member
Licensed User
Longtime User
@Inman

Sorry, it is not possible.
The only rowcolors are odd and even rows.

Oh ok. I noticed that colors of selected rows can be changed. Is it possible to set selected rows manually while disabling click based selection? I don't need much of user interaction with the table; just need to show some static data.

EDIT:

That's exactly what I ended up doing. I set AllowSelection and MultiSelection to True. I went to Table class and removed SelectRow() in Cell_Click(). Works great.
 
Last edited:

klaus

Expert
Licensed User
Longtime User
I am afraid NO, never tested.
To me, it looks not realistic that a user would have to scroll over 60000 rows.
Even with about 1000 rows the scroll becomes boringfor the user.
You should filter the data before loading it in the table.
 

Johan Hormaza

Well-Known Member
Licensed User
Longtime User
Si Klaus tendrá filtros.
Lo que sucede es que me temo que la mesa se ralentizará al cargar. He probado más de 3000 registros y funciona bien ...
 

klaus

Expert
Licensed User
Longtime User
I was thinking that you could have ListView with fast scroll to preselect data and then fill the table with, I would say, less than 1000 rows.
In the demo program, I find that scrolling the top table with about 400 rows is alrady boring.
 

Johan Hormaza

Well-Known Member
Licensed User
Longtime User
If I know, but my client prefers it anyway, I see that the Table works well with 30,000 records. Thanks KLAUS, I was very useful with your contributions, especially, I loved the "UpdateCell"
 
Last edited:

klaus

Expert
Licensed User
Longtime User
It's not a joke, but present your client a table with 10000 rows and ask him to use it in real conditions and then ask him what he does think about the usefullness.
Unfortunately, there are clients who want something, but don't really know what it implies, and of course have never tried it in real conditions.
Eventhough the client is supposed to be the king, as we say in my country, but...
 

luciano deri

Active Member
Licensed User
Longtime User
I'm using 1.44. In multiple selection, when i do click i edit a value in a column in correspondence row of db. How can refresh row to show the right value of modified column?
 

luciano deri

Active Member
Licensed User
Longtime User
Look at the last value in the SelectedRows property, it holds the last select row and column indexes.
I don't utherstud. Example:
B4X:
sub loadtable
StrQuery = "SELECT  Codice, descrizione, x  FROM table "
table.LoadSQLiteDB(dbSql, StrQuery,False)
end sub

Sub table_CellClick (Col As Int, Row As Int)
    fmu As Int
    StrQuery = "SELECT x FROM table WHERE Codice =
       table.GetValue(0,Row) & "'"
    DbCur = dbSql.ExecQuery(StrQuery)
    fmu = 0
    If DbCur.RowCount > 0 Then
        DbCur.Position = 0
        fmu = DbCurArt.GetInt("x")
    else
        return
    End If
           
    If fmu = 1 Then
        multipla_count = multipla_count - 1
        StrQuery = "UPDATE table SET X = 0 WHERE
               codice = '" & table.GetValue(0,Row) & "'"
        dbSql.ExecNonQuery(StrQuery)
    Else
        multipla_count = multipla_count + 1
        StrQuery = "UPDATE table SET x = 1 WHERE
                table.GetValue(0,Row) & "'"
        dbSql.ExecNonQuery(StrQuery)
    End If
    table.refreshTable
' this is the problem! Colum x not show new  value. I need reload all table
    End If
End Sub
 

luciano deri

Active Member
Licensed User
Longtime User
Don't use table.refreshTable it is not a public routine.
You can update a value in the table with Table1.SetValue(Col, Row, Value)
Good, and how can i paint row with SelectedRowColor if "X" cell value 1? I think that must modify table class in sub showrow?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…