B4A Library [Class] Flexible Table

Discussion in 'Additional libraries, classes and official updates' started by melamoud, Jun 30, 2013.

  1. Inman

    Inman Well-Known Member Licensed User

    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: Mar 21, 2018
    klaus likes this.
  2. Johan Hormaza

    Johan Hormaza Active Member Licensed User

    ¿Este estilo de tabla admitiría una base de datos de 20 campos y 60,000 filas?
    ¡Gracias!
     
  3. klaus

    klaus Expert Licensed 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.
     
    Peter Simpson and LucaMs like this.
  4. Johan Hormaza

    Johan Hormaza Active Member Licensed 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 likes this.
  5. Johan Hormaza

    Johan Hormaza Active Member Licensed User

    ¿Hay alguna forma de mejorar el rendimiento de la mesa?
    Gracias...
     
  6. Johan Hormaza

    Johan Hormaza Active Member Licensed User

    Esta es la cantidad
     

    Attached Files:

  7. klaus

    klaus Expert Licensed User

    What do you mean with 'improve performance' of the table?
     
  8. Johan Hormaza

    Johan Hormaza Active Member Licensed User

    En el momento de mover la tabla con el mayor número de registros
     
  9. klaus

    klaus Expert Licensed User

    There is no fast scroll implemented.
    It depends on what you want or need.
    How many columns do you have?
     
  10. Johan Hormaza

    Johan Hormaza Active Member Licensed User

    19 columnas
     
  11. klaus

    klaus Expert Licensed 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 likes this.
  12. Johan Hormaza

    Johan Hormaza Active Member Licensed 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: Mar 27, 2018
  13. Johan Hormaza

    Johan Hormaza Active Member Licensed User

    This is the way to edit a cell by clicking ...
     

    Attached Files:

  14. klaus

    klaus Expert Licensed 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...
     
    XbNnX_507 likes this.
  15. Johan Hormaza

    Johan Hormaza Active Member Licensed User

    jejeje it is
     
  16. luciano deri

    luciano deri Active Member Licensed 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?
     
  17. klaus

    klaus Expert Licensed User

    Look at the last value in the SelectedRows property, it holds the last select row and column indexes.
     
  18. luciano deri

    luciano deri Active Member Licensed User

    I don't utherstud. Example:
    Code:
    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
     
  19. klaus

    klaus Expert Licensed 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)
     
    luciano deri likes this.
  20. luciano deri

    luciano deri Active Member Licensed User

    Good, and how can i paint row with SelectedRowColor if "X" cell value 1? I think that must modify table class in sub showrow?
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice