Need helping using dynamic leaflet map in modal

I can get leaflet map in modal, but can't get it to work opening the modal from a dynamic table selecting one record an make leaflet show the location for that record.
I have a dynamic table and a seperate recordset to filter the results.

I also have a text field showing the id

And then I am stuck.
Any help would be appreciated.