I work on a laptop (14" screen) as my primary screen.
I also have a 21 inch screen as my extended display (used for browser display mostly).
The Feedback example hard-coded the number of table rows to 10 (Fine for most situations).
However, when I view the same grid on my laptop, I must scroll to see the entire grid of rows.
I could introduce some JS code that returns the screen height so I could programmaticly determine how many rows to display, but that is way above my current skill level with AMB...
I replaced the hard coded value of 10 with a Private var of iRecs (default 10).
I also created a FixedFooter to use as a toolbar (as suggested by alwaysbusy).
Within the footer, I added the ability to add a new record, adjust the row height and select a page of records. I hope to make this common to my theme.
The UP and DOWN controls of the Grid Rows increase or decrease the number of rows to display.
Each time either control is clicked, a call to LoadCases(1) is made.
The More and Less button clicks...
More....
Less....
I also have a 21 inch screen as my extended display (used for browser display mostly).
The Feedback example hard-coded the number of table rows to 10 (Fine for most situations).
However, when I view the same grid on my laptop, I must scroll to see the entire grid of rows.
I could introduce some JS code that returns the screen height so I could programmaticly determine how many rows to display, but that is way above my current skill level with AMB...
I replaced the hard coded value of 10 with a Private var of iRecs (default 10).
I also created a FixedFooter to use as a toolbar (as suggested by alwaysbusy).
Within the footer, I added the ability to add a new record, adjust the row height and select a page of records. I hope to make this common to my theme.
The UP and DOWN controls of the Grid Rows increase or decrease the number of rows to display.
Each time either control is clicked, a call to LoadCases(1) is made.
B4X:
' in Class_Globals
Private iRecs As Int = 10
' in Sub LoadCases(fromPage As Int)
' SQL_str =
& " LIMIT " & ((fromPage - 1) * iRecs) & ", "&iRecs
'at end of sub...
If (numcases mod iRecs > 0) Or (numcases = 0) Then
numcases = numcases/iRecs + 1
Else
numcases = numcases/iRecs
End If
' End Sub
The More and Less button clicks...
B4X:
Sub MoreBtn_Clicked(Target As String)
iRecs = iRecs + 1
LoadCases(1)
Log(" Irecs: "&iRecs)
End Sub
Sub LessBtn_Clicked(Target As String)
iRecs = iRecs - 1
If iRecs < 2 Then
iRecs = 2
End If
LoadCases(1)
Log(" Irecs: "&iRecs)
End Sub
More....
Less....