B4J Question Show X/Y in B4XTable Pager Controls

cklester

Well-Known Member
Licensed User
Is there a way to put the number of pages in the B4XTable pager controls, so it shows Current/Total?

I searched the forum and couldn't find anything about it.

 

William Lancee

Well-Known Member
Licensed User
Longtime User
I looked at B4XTable.bas. Untested, but ...

B4X:
Table1.lblNumber.text = Table1.GetCurrentPage & "/" Ceil(Table1.GetSize / Table1.GetRowsPerpage)

If it doesn't work, take a look yourself. Unzip B4XTable.B4Xlib in C:\Program Files (x86)\Anywhere Software\B4J\Libraries
 
Upvote 0

William Lancee

Well-Known Member
Licensed User
Longtime User
The .Get... are class 'getters' and you can omit the Get part. It works both ways.
You do need to leave some room for both numbers, they may be large.
Place the code in B4XTable1_DataUpdated

B4X:
    B4XTable1.lblNumber.left = 40dip
    B4XTable1.lblNumber.Width = 100dip
    B4XTable1.lblNumber.TextSize = 18
    B4XTable1.lblNumber.Text = B4XTable1.CurrentPage & "/" & Ceil((B4XTable1.Size / B4XTable1.RowsPerPage))
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…