B4A Library [Class] Flexible Table

Bhrt60

Member
Licensed User
I've just looking at Table v2.13 example

Using Samsung Galaxy S7 how can I get the both Tables to use the Full width (portrait mode) ?
at the moment the tables are both different width & sort of awkwardly placed - sort of centered

I would like both tables to use the Full width and both aligned to the left

I looked at the code but not able to see how I can change them

Couple of other questions:
(1) is its possible to EDIT the content of a cell & save back to db?
(2) I see an option to remove row - is there anyway to add a row and save back to db ?
 

klaus

Expert
Licensed User
Longtime User
I would like both tables to use the Full width and both aligned to the left
How do you add the Tables?
In the Designer you should set the horizontal anchor to BOTH.
In the main code you could use %x values. Example:
Table1.AddToActivity(Activity, 50dip, 20dip, 300dip, 100%x - 50dip)

1) No, you cannot edit a cell directly, the cells are Labels and not EditTexts. You need to do it on your own, and update the value in the Table.
2) Yes, you have the insertRowAt function. But you need to update the database on your own.
The Table and the database are not linked together and the Table content depends on the SQL query which will not always show the whole database.
 

Bhrt60

Member
Licensed User

There are a lot of examples & I guess lot of programers are using B4A
and I guess its all done by volunteers like you

As a non-programer I'm disappointed that there are NO "Practical" Examples available
(if there are I've missed them!!)

5 years ago I started using MS Access & having Northwind WORKING example helped a LOT
I modified it to our requirements and now it's used for Service Management, Purchase orders, Invoices
everything apart from accounting

Without WORKING & PRACTICAL examples I would never have got started

I've spent 2 weeks (because I have other duties I can only manage a few hours a day) looking at examples but not been able to produce BASIC useable app !!!

PITTY really

I guess will be 1000's like me but some will give up !
 
Last edited:

klaus

Expert
Licensed User
Longtime User
As a non-programer I'm disappointed that there are NO "Practical" Examples available
What kind of examples are you missing?
There are examples showing basic principles in the B4A Beginner's Guide and the B4A User's Guide and also in the forum.
Not sure you will find examples fitting exactly what you want.
 

Bhrt60

Member
Licensed User
I'm not asking nor do I expect Full Apps as a such

Just something that shows the whole process of adding updating a Tabel (ideally a set of related tables)

Ok, take Table V2.13 as an example.
(I'm using this because earlier table 1.0 etc is 4-5 years old and I notice various bug/improvements so my thoughts are v2.13 is the latest so should start with that)

For a beginner like me it looks like a confused mess!
take for instance the code includes citylist.csv example from earlier iteration which is not being used here

For a career programmer this might be useful bunch of code...
but for a novice...

Ideally, would like to see a complete example to load a SQLite table into a List control
Allow the user to Add a record or select Record to edit via a Form and put it back to List AND update the SQL DB at the sametime

(since its possible know the Cell value perhaps a pop-up windows to allow Edit of the cell value will do if edit in grid is not possible).

Also in this example displaying the 2nd List from the same table seems totally pointless
again I would like to see a RELATED table - staying with the People theme this could be the persons Children's names

(Going to Northwind example - you have Customers and their related Orders)
 
Last edited:

grupotgr

Member
Licensed User
Longtime User
Hi all, I need to filter the table while I am writing in textchanged, now I am using jumptorowandselect, but it is not the most effective solution. My code for now is as follows:

B4X:
Sub txtBuscarArticulo_TextChanged (Old As String, New As String)

    strArt = txtBuscarArticulo.Text
  
    For i = 0 To Table1.Size -1
        Dim lineas As String
        lineas = Table1.GetValue(1, i)

        If lineas.Contains(strArt) = True Then
            Table1.JumpToRowandselect(i,2)
            fila = i

End Sub


Please, can you give me some idea?
 

grupotgr

Member
Licensed User
Longtime User
I want to show in the table the results you find according to what is written in the edittext.
Sorry for my bad English!!
 

klaus

Expert
Licensed User
Longtime User
If you really want to show the row where the partial text matches the text in the column, it's the only solution with the Table class.
But, effectively it's by far not efficient.
Do you exit the routine after the first match?
B4X:
 If lineas.Contains(strArt) = True Then
    Table1.JumpToRowandselect(i,2)
    fila = i
 

grupotgr

Member
Licensed User
Longtime User
I am working with a MYSQL DB, PHP, and SQLite, I am bringing the data from mysql using PHP, then I show them in the table with this same class (table), I now need to show the results (filter on the table / grid) that contain what the user is typing on the edittext, but I can`t find a way to make it work.
Thanks!!
 

grupotgr

Member
Licensed User
Longtime User
No, I can´t because I enter values inside the cells and then save them. And with the loadsqlitedb each time I filter it obviously deletes all the values I entered.
 

grupotgr

Member
Licensed User
Longtime User
Yes, I know, sorry if I wrote in a bad way. (It's because of my horrible English). Thanks for the help
 

ronin69

Member
Licensed User
Longtime User
Hi

Can i delete the X rows at the end of the table ?

Thanks

Gianluca Gaggi
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…