Addevent Table

tvrman

Member
Licensed User
Hi Guys,

Could someone give me an example of the Addevent in combination
with the table?,

In runtime i created some tables, but i need the selection_onchanged event to, now i need to create x subs like table1_selectiononchanged(....
I supose this can be solved at the Addevent :cool:

Cheers
 

Cableguy

Expert
Licensed User
Assuming that what you ment was "selection changed" and not "selection on changed," It should be something like:

AddEvent ("Table1", selectionchanged, "Table1_selectionchanged")
 

Erel

Administrator
Staff member
Licensed User
B4X:
Sub App_Start
    Form1.Show
    AddTable("form1","t2",20,30,100,100)
    t2.AddCol(cstring,"c1",50)
    t2.addrow(23)
    t2.addrow(24)
    AddEvent("t2",SelectionChanged,"TablesEvent")
    End Sub


Sub TablesEvent (ColName, Row)
    form1.Text = t2.Cell(colname,row)
End Sub
Note that it is not required to always use AddEvent.
You could just write:
B4X:
Sub t2_SelectionChanged (ColName,Row)
There is a new tutorial that covers these issues: http://www.basic4ppc.com/forum/showthread.php?t=907
 
Top