Hi everyone!
I don't know if it is possible ... When the Activity initializes I need my BXTable "goes to" the last Row. I know you'll say "Hey change the sql sentence ex. "ordeb by Id desc". but I'd like avoiding that since when I have to edit by clicking on the table the RowIds make a mess.
So as I said I don't know if it's possible do that.
In order to show my records I'm using this code
Then my JobDone
It is working .. but my Bxtable is small and I just can see 2 records so when I insert a third record I must use the ">>" botton to go the last record.
I don't know if it is possible ... When the Activity initializes I need my BXTable "goes to" the last Row. I know you'll say "Hey change the sql sentence ex. "ordeb by Id desc". but I'd like avoiding that since when I have to edit by clicking on the table the RowIds make a mess.
So as I said I don't know if it's possible do that.
In order to show my records I'm using this code
B4X:
Sub CargarGridCampanias
ProgressDialogShow("Recurperando Campañas desde el Server")
ExecuteRemoteQuery("SELECT * FROM campania",GRIDCAMPANIAS)
End Sub
Then my JobDone
B4X:
Sub JobDone(Job As HttpJob)
Select Job.JobName
Case GRIDCAMPANIAS
Dim ListaCampanias As List
ListaCampanias.Initialize
ListaCampanias = parser.NextArray
For i = 0 To ListaCampanias.Size -1
' Dim MapaListaCampania As Map
' MapaListaCampania = ListaCampanias.Get(i)
Log(ListaCampanias.Get(i))
Next
BXTBLCAMP.AllowSmallRowHeightModifications= False
BXTBLCAMP.AddColumn("ID", BXTBLCAMP.COLUMN_TYPE_NUMBERS).Width = 30dip
BXTBLCAMP.AddColumn("NOMBRE CAMPAÑA", BXTBLCAMP.COLUMN_TYPE_TEXT).Width = 200dip
BXTBLCAMP.AddColumn("ESTADO",BXTBLCAMP.COLUMN_TYPE_TEXT).Width=130dip
Dim listaCamp As List
listaCamp.Initialize
For Each minimap As Map In ListaCampanias
Dim id As Int = minimap.Get("ID")
Dim nombre As String = minimap.Get("NOMBRE")
Dim estado As String = minimap.Get("ESTADO")
Dim renglon(3) As Object
renglon(0) = id
renglon(1) = nombre
renglon(2) = estado
listaCamp.Add(renglon)
Next
BXTBLCAMP.SetData(listaCamp)
It is working .. but my Bxtable is small and I just can see 2 records so when I insert a third record I must use the ">>" botton to go the last record.
Last edited: