Pass data table row to other component

Hi,
i’m stuck at the following problem for a couple of days. I have found allot of documentation about the data tables but i can’t sort it out.

I have structured the test app as follow:
1) HomeForm
2) ClientOverviewComponent
3) ClientDetailsComponent

ClientOverview has a datagrid linked on the databse on table ‘clients’ with two test columns ‘name’ & ‘email’. ClientOverviewC is loaded on the content panel in HomeForm.
I managed to get the row ID from the table on the itemtemplate to be printed out on the terminal. However i fail to pass this unique row ID to ClientDetailsComponent to call this row to display on ClientsDetail. When the user click the link on the name in the datagrid i want to load the ClientDetailsComponent in HomeForm and display the name and email to labels. How can i aproach this best?

Thank you for your help to sort out a beginner! :slight_smile:
Benjamin

hi @benjaminvdz and welcome to the forum,

rows are just objects and can be passed around - i’d avoid using the row ids here.

when you instantiate the ClientDetailsComponent you can pass it the row like

row = # the table row
client_component = ClientDetailsComponent(item=row)

And then load the client_component however you were doing it already.

1 Like

Thanks for your input, gonna test it out! Have a great weekend.

1 Like