B4J Library [B4X] [XUI] SD FlexGrid (Table)

Star-Dust

Expert
Licensed User
Longtime User
I didn't quite understand your problem. However to scroll from code use ScrollX and ScrollY
 

Mauricio Pereira

Member
Licensed User
Longtime User
I didn't quite understand your problem.
Star-Dust,
I'll try to explain better.
Be, for example, a table with 6 columns and several rows.
On the smartphone screen, only columns 1, 2 and 3 appear (because of the screen size).
By code,
I do Flexgrid1.SelectCell(row 0, column 1). The cell (0,1) is "colored" indicating the selection.
Next I do FlexGrid1.SelectCell(row 0, column 2 ). Cell (0,2) is selected. I do the same for column 3. It is selected and visible.
When I go to the cell (0,4), which is not visible on the screen, it is selected but the screen scrolling does not happen. Ideally, columns 2, 3 and 4 should be visible. And so on.
I can only see the cell (0,4) selected by scrolling with my finger on the screen. I wish I could do this by code.
If Editonsite is used instead of selectCell, scrolling works as desired.
 

Star-Dust

Expert
Licensed User
Longtime User
Now I understand. I didn't expect the grid to position itself on the cells selected by code(SelectCell). I will consider it for the future.

Surely it will not be possible for the command to select multiple cells (SelectCells) because if the selected cells exceed the dimensions of the visible ones, it would force me to create an algorithm that chooses which cells to show.
 

Mauricio Pereira

Member
Licensed User
Longtime User
OK. I understood.
Obviously I don't know the kernel of your library but the EditOnSite command scrolls exactly as desired.
Many thanks for your prompt responses.
 

Star-Dust

Expert
Licensed User
Longtime User
OK. I understood.
Obviously I don't know the kernel of your library but the EditOnSite command scrolls exactly as desired.
Many thanks for your prompt responses.
There is no positioning on the cell on EditOnSite, if it happens to you that it moves I can assure you that it is not due to a positioning instruction of my code, rather it is due to a management that iOS makes of the scrollView when a TextField is active to be written

Note that there is ScrollToRow which positions on the requested row.
 

David Hawkins

Active Member
Licensed User
Longtime User
Hi Star-Dust how do I center a FlexGrid1.TypeCheck vertically in IOS, it centers horizontally OK but not vertically.

Regards
David
 

Star-Dust

Expert
Licensed User
Longtime User
Hi Star-Dust how do I center a FlexGrid1.TypeCheck vertically in IOS, it centers horizontally OK but not vertically.

Regards
David
At the moment it is not possible to make vertical adjustments
 

David Hawkins

Active Member
Licensed User
Longtime User
Hi Star-Dust,

I have a Flex grid with 7 columns each 120dip wide and multiple rows, which means I can only see 4 visible columns and 3 are hidden.

When I scroll horizontally all is well, however if I have scrolled to a hidden column and then scroll vertically the grid automatically moves back to the left and I am only seeing the visible columns again. Is there a way to scroll vertically and still show the hidden columns?

Many Regards
David
 

Star-Dust

Expert
Licensed User
Longtime User
On which platform do you have this problem? Can you attach a short video in GIF format?
 

David Hawkins

Active Member
Licensed User
Longtime User
Hi Star-Dust I have created a small video which shows the problem, as I said yesterday it is the B4i platform it is OK on B4a.
I converted an mp4 video file to gif but that is 10 times larger so I will attach the mp4 which I hope you can run.
Regards
David

Unfortunately the video is too large (2MB) to upload is there another way to get it to you? I could use 'wetransfer' but I would need your email address?
 

Star-Dust

Expert
Licensed User
Longtime User
You can use this site to turn a video into gif and reduce its size, resolution and compress. I have no other suggestions at the moment.

I'll do some tests as soon as I have time
 

Star-Dust

Expert
Licensed User
Longtime User
Update rel 0.41
  • fix bug
 

Sergio Haurat

Active Member
Licensed User
Longtime User
Hello, your code is amazing. I wanted to propose to incorporate in the edition, add a mask. Using your example:

Wish:
    FlexGrid1.ColsName=Array As String("","N","On","Name","Img","Digit")
    FlexGrid1.ColsWidth=Array As Int(75dip,50dip,50dip,100dip,60dip,100dip)
    FlexGrid1.ColsType=Array As Int(FlexGrid1.TypeButton,FlexGrid1.TypeInt,FlexGrid1.TypeCheck,FlexGrid1.TypeString,FlexGrid1.TypeImage,FlexGrid1.TypeFloat)
    FlexGrid1.ColsAlignment=Array As String("CENTER","CENTER","CENTER","LEFT","LEFT","RIGHT")
    FlexGrid1.ColsMask=Array As String("","","","","","#.##") 'or FlexGrid1.ColsMask=Array As String(Null,Null,Null,Null,Null,"#.##")

Do you think it is possible?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…