B4A Library [Class] Flexible Table

klaus

Expert
Licensed User
Longtime User
What is " LoadSQLiteDB_Custom_Widths " ?
What error do you get ?
I have checked the LoadSQLiteDB in both versions 1.29 and 1.43 they are exactly the same.

I have never use adMob.
You might check step by step what happens when you use adMob.
 

syncmaster13

Member
Licensed User
Longtime User
Now I get it, "LoadSQLiteDB_Custom_Widths" it was my Sub I added and forgot about it. It does nothing else just stretch table to screen width in case there is only one column. Sorry for confusion.

About adMob. I never had a problem before adMob V2.0 . What is happening is very simple. I have a tables that loads sqlite data and it's visible only until
ads get refreshed.
 

klaus

Expert
Licensed User
Longtime User
About adMob. I never had a problem before adMob V2.0 . What is happening is very simple. I have a tables that loads sqlite data and it's visible only untilads get refreshed.
As already said, I have no experience with adMob.
 

syncmaster13

Member
Licensed User
Longtime User
Hello Klaus
Is there a way to get a table height in dip? I have a panel that contain a table, which change the number of rows. I would like to
adjust panel height to fit to table height.

Thanks
 

klaus

Expert
Licensed User
Longtime User
What panel height do you want to change ?
If you remove a row with Table1.RemoveRow(Index) the internal panel height is updated in the class !

If you really want it , thats the code for the table height:
B4X:
Height = Table1.Height
Height of all the rows, the height of the internal scrollview panel:
B4X:
TableHeight = Table1.Size * Table1.Rowheight
You can get the Header hieght with:
B4X:
HeaderHeight = Table1.HeaderHeight
The heights are in pixels, that's what you need, not the dip values.
 
Last edited:

syncmaster13

Member
Licensed User
Longtime User
I basically have 2 panels containing tables, and I want a bottom panel be always at the same distance from upper panel. So if upper table change and contain more rows the bottom panel has to move down by certain amount of pixels.

It's working now, Thanks
 

DrAlex

Member
Licensed User
Longtime User
Hello Klaus,

I have a table on a panel. I want the table to ignore the Touch event and let the event propagate to the panel.

How do I do it?

Thanks.
 

klaus

Expert
Licensed User
Longtime User
I have a table on a panel. I want the table to ignore the Touch event and let the event propagate to the panel.
Why do you need this ?
It's not possible in the class code. Or it would become a new not compatible class.
As a workaround you could add a transparent Panal above the Table and use its Touch event.
 

DrAlex

Member
Licensed User
Longtime User
Why do you need this ?
It's not possible in the class code. Or it would become a new not compatible class.
As a workaround you could add a transparent Panal above the Table and use its Touch event.

In my app the table may become wider and/or higher than the screen, and I want the user to be able to move the table left/right/up/down. There is also a label above the table, which shall move together with the table.
 

klaus

Expert
Licensed User
Longtime User
In my app the table may become wider and/or higher than the screen ...
Sorry, I don't understand !
What will become wider than the sceen ?
The Table class is based on ScrollView2D, which assures the scrolling !
How do you define the Table ?
 
Last edited:

DrAlex

Member
Licensed User
Longtime User
Sorry, I don't understand !
What will become wider than the sceen ?
The Table class is based on ScrollView2D, which assures the scrolling !
How do you define the Table ?
Hello Klaus,

Indeed, if the table's ActualWidth is bigger than the Width, you can scroll it horizontally to see all the columns. But in that case I see a narrow vertical strip at the left and the right of the table. The strip's color is changing gradually from white to black (at least in my case, where the row color is white and the panel below is black).

I didn't like that aesthetically, therefore have decided to make Width = ActualWidth and let the user move the table left and right with a finger to see the full contents.

As I understand from you it cannot be done, and here I have two more general questions:

  1. Is there a way to make the table behave like in HTML: with text wrapping and automatic cell widths?
  2. Is there a standard event propagation mechanism in B4A: if the child does not process the event, then the event is passed on to the parent?
 

klaus

Expert
Licensed User
Longtime User
What version of the Table class are you using ?
1. Is there a way to make the table behave like in HTML: with text wrapping and automatic cell widths?
How do you populate the Table ?
Automatic wrapping yes (with predefined column widths), but no cell height adjustment, all rows must have the same height.
Automatic width yes.
If you load a csv file or load from SQLite you have the AutomaticWidth parameter.
Otherwise you have the AddRowAutomaticWidth(Values() As String) routine.
2. Is there a standard event propagation mechanism in B4A: if the child does not process the event, then the event is passed on to the parent?
The cells in the Table are Labels and these don't have the event propagation mechanism.
 

ivan.tellez

Active Member
Licensed User
Longtime User
I didn't like that aesthetically, therefore have decided to make Width = ActualWidth and let the user move the table left and right with a finger to see the full contents.

That is not how the table shoul behave. You are doing something wrong.

Please download the latest version of the class. Read the documentation, and the code. Also open and understand the available examples.
 

vbmundo

Well-Known Member
Licensed User
Hi,

I quit the old Table.Bas from my Proyect and add this new Table2.0

But when compile I have error at this line

Private cTextSize As Float
Type RowCol (Row As Int, Col As Int)
Private cAlignment As Int

"An item with the same key is added."

What's wrong ?

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