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

Cheers
 

Cableguy

Expert
Licensed User
Longtime 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

B4X founder
Staff member
Licensed User
Longtime 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.b4x.com/forum/showthread.php?t=907
 

tvrman

Member
Licensed User
May i see again thank you !

:sign0188:
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…