For some time I have been thinking of creating a view that has grids.
The (great) Class Flexible Table (by @klaus) already exists and is used continuously.
But I thought of something different, a grid to which you could add are not cells containing text and numbers, but also checkboxes, and images (and who knows even buttons)
A grid that could be used to determine the width of each column and the height of each row.You could change the color to a single cell, select a row or a column or a single cell, let the cells be editable ... etc. ...
Also something that was good for Android and for IOS. (XUI)
Yesterday so I started to throw something down in my spare time (little) and this is what I did in a couple of hours ....
I am keen to find out how this project will evolve
The (great) Class Flexible Table (by @klaus) already exists and is used continuously.
But I thought of something different, a grid to which you could add are not cells containing text and numbers, but also checkboxes, and images (and who knows even buttons)
A grid that could be used to determine the width of each column and the height of each row.You could change the color to a single cell, select a row or a column or a single cell, let the cells be editable ... etc. ...
Also something that was good for Android and for IOS. (XUI)
Yesterday so I started to throw something down in my spare time (little) and this is what I did in a couple of hours ....
B4X:
Activity.LoadLayout("Layout1")
' Set Header Text
FlexGrid1.ColsName=Array As String("Num","Selc","Name","Img","Digit")
' Set Clumn Width
FlexGrid1.ColsWidth=Array As Int(75dip,50dip,100dip,40dip,150dip)
' Set Type of Dates
FlexGrid1.ColsType=Array As Int(FlexGrid1.TypeInt,FlexGrid1.TypeCheck,FlexGrid1.TypeString,FlexGrid1.TypeImage,FlexGrid1.TypeFloat)
FlexGrid1.ColsAlignment=Array As String("CENTER","CENTER","LEFT","LEFT","RIGHT")
Dim B As Boolean=False
For i=1 To 25
B=Not(B)
FlexGrid1.AddRow(Array As Object(i,B,"User " & i,Null,Rnd(50,10000)/100))
' AddRow2 can set rowWidht
'FlexGrid1.AddRow2(Array As Object(i,B,"User " & i,LoadBitmap(File.DirAssets,"b4a.png"),Rnd(50,10000)/100),60dip)
Next
FlexGrid1.SetCell(0,0,100)
FlexGrid1.SetCell(1,2,"User 200")
FlexGrid1.SetCell(0,3,LoadBitmap(File.DirAssets,"b4a.png"))
FlexGrid1.SetCell(2,3,LoadBitmap(File.DirAssets,"b4j.png"))
FlexGrid1.SetCell(4,3,LoadBitmap(File.DirAssets,"b4i.png"))
'FlexGrid1.SetRowHeight(1,60dip)
'FlexGrid1.SetColWidth(3,40dip)
FlexGrid1.Invalidate
I am keen to find out how this project will evolve
Last edited: