B4A Library [Class] Flexible Table

Eric McDonald

Member
Licensed User
B4X:
    If Register_CellClick(sCol,sRow) = False Then
        Log("Error")
    Else If Register_CellClick(sCol,sRow) = True Then
        Dim FullString As String
        Dim MyTextWriter As TextWriter
        MyTextWriter.Initialize(File.OpenOutput(File.DirRootExternal, "test.csv",True))
        newID = register.GetValue(0,sRow)
        newPO = register.GetValue(1,sRow)
        newCust = register.GetValue(2,sRow)
        newComm = register.GetValue(3,sRow)
        FullString = newID & "," & newPO & "," & newCust & "," & newComm
        MyTextWriter.WriteLine(FullString)
        MyTextWriter.Close
        Log("Success")
    End If

I was able to find a solution to this issue
 

fishwolf

Well-Known Member
Licensed User
Longtime User
With table to full screen and fixed first column

the table to bottom-left have a black-hole
 

Attachments

  • TableV3_08.zip
    47.4 KB · Views: 204
  • Screenshot_2020-03-06-12-18-08.png
    105.6 KB · Views: 219

fishwolf

Well-Known Member
Licensed User
Longtime User
Thank you for reporting this bug.
The Class has been updated to version 3.09 in the first post.
Thanks, but with this version and FirstColumnFixed = true the last column is showed for half size

is it possible have a parameter for set the number of fixed columns?
 

klaus

Expert
Licensed User
Longtime User
Thanks, but with this version and FirstColumnFixed = true the last column is showed for half size
On my device it works OK.
Can you post your project, so I can look what exactly happens.
is it possible have a parameter for set the number of fixed columns?
No, not in this version and not in my pipeline.
 

fishwolf

Well-Known Member
Licensed User
Longtime User
On my device it works OK.
Can you post your project, so I can look what exactly happens.
No, not in this version and not in my pipeline.

the table show 6 columns, but the class, show a error on columns number
 

Attachments

  • TableV3_09_FULL.zip
    171.1 KB · Views: 241

fishwolf

Well-Known Member
Licensed User
Longtime User
Sorry

but with FirstColumnFixed=True doesn't work the header align

B4X:
Dim Alignments() As Int
 Alignments = Array As Int(Gravity.LEFT, Bit.Or(Gravity.LEFT, Gravity.CENTER_VERTICAL), Gravity.CENTER, Gravity.LEFT, Gravity.LEFT, Gravity.LEFT, Gravity.LEFT, Gravity.LEFT, Gravity.LEFT, Gravity.LEFT)
 Table1.SetHeaderAlignments(Alignments)
 Table1.SetCellAlignments(Alignments)
[code]
 

Attachments

  • Bug3.png
    11.6 KB · Views: 209

fishwolf

Well-Known Member
Licensed User
Longtime User
Can you please test the class from the attached project.
Perfect, work fine. Thanks

I would like to contribute with a 3.12 version where you can set each row with a color from 5 custom colors
 

Attachments

  • Table.bas
    96.4 KB · Views: 209
  • Screen.png
    30.1 KB · Views: 211
  • use.png
    8.9 KB · Views: 213

klaus

Expert
Licensed User
Longtime User
I tried your project.
Unfortunately, it doesn't work.
You have three lines like this cRowColor3 = Props.Get("Row3Color") in DesignerCreateView.
But you don't have the equivalent #DesignerProperty: Key: Row3Color, DisplayName: Row 3 color, ... lines !?
Do you have a working project?

Are you sure that it works with the lazy loading method?
 

fishwolf

Well-Known Member
Licensed User
Longtime User
Sorry, i have attach the original project and example for custom color
 

Attachments

  • TableV3_12_CUSTOMCOLOR.zip
    414.9 KB · Views: 211
  • TableV3_12_ORIGINAL.zip
    301.7 KB · Views: 206
  • Table.bas
    97 KB · Views: 182

fishwolf

Well-Known Member
Licensed User
Longtime User
other question:
i used a old version (1.11) and now migrate to last version

old version when the text are long, go to a new line, le new version not
is it possible replicate this feature on last version?

Thanks
 

Attachments

  • Acapo.jpg
    42.8 KB · Views: 189

klaus

Expert
Licensed User
Longtime User
Now, I got it to run.
There were two problems.
I first load your test project from post#936 and then copied the Table.bas file to my demo program..
There were these lines missing:
#DesignerProperty: Key: Row3Color, DisplayName: Row 3...
Added those, but then I got another error. So i stopped.
Then I tested your project from post#938, it worked.
I copied the Table.bas file to my demo program and got the same error as before.
I found the error:
In Table.bas, line 2432 cTypeFaces = TypeFaces must be cTypeFaces0 = TypeFaces.
I checked my Table.bas file from version 3.11 and that line was OK. Don't know when nor why the '0' was removed.

Another problem is the new AddRow method. As its signature has changed it is not backward compatible.
I renamed it to AddRow2 and added a new AddRow routine with the original signature to be backward compatible.

I will further work on it.
I have some other ideas.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…