Dim row(11) As String
For i = 0 To CurD.RowCount - 1
tb.AddRow(row)
Next
For i = 0 To tb.NumberOfRows - 1
tb.SetValue(0, i, i)
Next
' draw a Row, now col is hidden (width <2)
Private Sub ShowRow(Row As Int)
For I = 0 To lbls.Length - 1
If (Header.GetView(I).Width > 1 ) Then
SV.Panel.AddView(lbls(I), Header.GetView(I).Left, Row * cRowHeight, Header.GetView(I).Width, cRowHeight - cLineWidth)
lbls(I).Text = values(I)
For i = 0 To tb.NumberOfRows - 1
tb.SetValue(0, i, i)
Next
I am working with a MYSQL DB, PHP, and SQLite, I am bringing the data from mysql using PHP, then I show them in the table with this same class (table), I now need to show the results (filter on the table / grid) that contain what the user is typing on the edittext, but I can`t find a way to make it work.
Thanks!!
What is the trouble ?
Please, I need some help. I'm stuck and I need to make progress on this project. Thanks
Dim row(11) As String
For i = 0 To CurD.RowCount - 1
tb.AddRow(row)
Next
For i = 0 To CurD.RowCount - 1
Dim row(11) As String
tb.AddRow(row)
Next
Ok, i must intercept a scroll finish event and after make a new query...Not inside the Table.
You need to manage it yourself.
Trying to scroll more than a few hundreds of rows is not realistic from my users point of view.
Private Sub Cell_Click
Dim rc As RowCol
Dim L As Label
L = Sender
rc = L.Tag
' SelectRow(rc.Row)
SelectRow(rc)
If SubExists(cCallBack, cEventName & "_CellClick") Then
CallSub3(cCallBack, cEventName & "_CellClick", rc.Col, rc.Row) 'should be rc.Row, rc.Col
End If
End Sub
I have thinked this solution. What do you think about it?The only event is Private Sub SV_ScrollChanged.
You need to check there.
Private LimiteQuery As Int
'Modify on class table
' the caller can set this variable
Public Sub setLimiteQuery(LQ As Int)
LimiteQuery = LQ
End Sub
Private Sub SV_ScrollChanged(PosX As Int, PosY As Int)
....
'add thi code
Dim n, n2 As Int
n = maxVisibleRow + 1
n2 = currentMax + 1
If SV.ScrollingIsFinished And n2 = LimiteQuery And Not (Fine) Then
Fine = True
UltimaRiga
End If
If n < LimiteQuery Then
Fine = False
End If
If SV.ScrollingIsFinished And currentMin <= 0 And Not (Inizio) And maxVisibleRow > - 1 Then
Inizio = True
PrimaRiga
End If
If minVisibleRow > 0 Then
Inizio = False
End If
End Sub
' return to the caller when scroll stop on last and frist page
Private Sub UltimaRiga
If SubExists(Callback, Event & "_UltimaRiga") Then
CallSub(Callback, Event & "_UltimaRiga")
End If
End Sub
Private Sub PrimaRiga
If SubExists(Callback, Event & "_PrimaRiga") Then
CallSub(Callback, Event & "_PrimaRiga")
End If
End Sub
'Modify on projet
Sub Tabl_UltimaRiga
Pagina = Pagina + 1
Tabl.ClearAll
LoadSqliteDb
End Sub
Sub Tabl_PrimaRiga
If Pagina > 1 Then
Pagina = Pagina - 1
Tabl.ClearAll
LoadSqliteDb
End If
End Sub
Sub LoadSQLiteDB
limitequery = 300
Tabl.setLimiteQuery(limitequery)
StrQuery = "SELECT ..."
limini = (Pagina - 1 ) * limitequery
StrQuery = StrQuery & " LIMIT " & limini & " , " & limitequery
Tabl.LoadSQLiteDB(Main.dbSql, StrQuery,False)
End Sub
it seems to work fine ...You should try it.