B4A Library [Class] Flexible Table

Frank.G

Member
Licensed User

Just for Info
I can confirm, also had to edit the Table.bas @ cSingeline=False to get it to work.
All other things I tried (the posted solutions in this thread) did not work.

Maybe I did something wrong in how I coded my app, anyways it works now .

Frank
 

Frank.G

Member
Licensed User
Can you post your code or bette a small project showing the problem.

Moving
HerTabel.RowHeight=100dip
HerTabel.SingleLine=False

before
HerTabel.SetColumnsWidths(Array As Int(100dip,400dip))
works, I tested it.

See attached ZIP file.
The app will not compile correct as it is missing the File Purin.db what I don't attach beacause of copyright.
It is an SQL File containing two columns "Name" and "Purin" in a Table called "Lebensmittel"

Also the ZIP contains the modified Table.bas.
The concerning table is on the second page and contains the data that is selected/copied via Long_click from an B4XTable row.

Hope you can see what my spagetti code tries to do here

Thanks for the help
Frank
 

Attachments

  • purcal_noDB.zip
    37.1 KB · Views: 206

klaus

Expert
Licensed User
Longtime User
I had a look at your project.
Yes. HerTabel.SingleLine = False has no effect.
HerTabel.RowHeight = 100dip works.
The work when loading a database into the table, that's how I tested it.
When rows are added in the code HerTabel.SingleLine = False has no effect.
Attached your project with the new Table version 3.01 class.
I left my test changes in the code.
 

Attachments

  • purcal_noDB_New.zip
    40.1 KB · Views: 210

Manaf Alajrad

Member
Licensed User
Hey Klaus,
First of all Thank you for this amazing table.
I'm having a problem trying to set the SelectedRowColor in the CellClick Sub, when the cell is clicked the table disappear totally.

sorry for bothering you with this, and many thanks.

This is the code:

Sub Table1_CellClick(col As Int, row As Int)
Table1.SelectedRowColor = Colors.Red
End Sub
 

klaus

Expert
Licensed User
Longtime User
What exactly do you want to do and what do you expect?
I suppose that you want to set the color of the row you are currently selecting, this will not work.
The SelectedRowColor property sets the color of selected rows in general, you cannot set different colors for different selected rows.
If you really want to set the color for the selected rows in general, set it before you fill the table.
 

Manaf Alajrad

Member
Licensed User


thanks for answering, now I understand.

what a really need now is to deactivate the SelectedRow, I need that the table does not change its color.

Sorry for the rusty english that I have.
 

manuelsalazar

Member
Licensed User
hI :
I am using the TableV1_44 routines.....
How can I use it in a program that close any table when you click anywhere outside the table, I mean to use it as popup table in a consult.

Thanks in advanced.
Manuel
 

manuelsalazar

Member
Licensed User
There are 2 objects : Table1 , pnlTable
You mean that I have to put in the designer of my screen form and set invisible , then change the status when needed ?
 

klaus

Expert
Licensed User
Longtime User
It depends on how your layout is constructed.
You can use the Click event of the Activity, this is implemented in the demo program but just commented.
You can try this in the demo program.
You can also eliminate pnlTable and add Table1 directly onto the Activity.

The version 1.44 is a very old version, the latest version is 3.02, which is a CustomView and can be added in the Designer.

Attached the V1_44 demo program without pnlTable.
 

Attachments

  • TableV1_441.zip
    44.9 KB · Views: 201
Last edited:

klaus

Expert
Licensed User
Longtime User
The Table class has been updated to Version 3.03 in the first post.
- Changed JumpToRowAndSelect(Row As Int, Col As Int) to JumpToRowAndSelect(Col As Int, Row As Int)
- Changed LoadSQLiteDB2 signature. Replaced the possible values from "T", "I", "R" to "TEXT", "NUMBER" for coherence with SetColumnDataTypes
- Added internal sorting bitmaps, avoids loading the image files into the Files folder
- Added two new properties: SortBitmapWidth and SortBitmapColor.
- Added SetCustomSortingBitmaps method, which allows to use custom bitmaps instead of the internal ones.
 

vecino

Well-Known Member
Licensed User
Longtime User
- Changed JumpToRowAndSelect(Row As Int, Col As Int) to JumpToRowAndSelect(Col As Int, Row As Int)
Now we can't forget to check code to change it
Thank you very much for this much needed class. Is fantastic.
 

aeric

Expert
Licensed User
Longtime User

I think the date should be 2019.11.12
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…