The scenario - I want a lightbox of various pieces of information for a Team member to pop up over a repeater showing all Team members. All fields are populated from a Team database - the repeater is pre-populated from the data.
My problem is that the image is picked up & shown on the Lightbox but the rest of the fields are not.
I’ve used a console display of the TeamMemberRecord (which is the data passed to the Lightbox) & all data is there.
I’ve used this code on the repeater page:
import wixWindow from ‘wix-window’ ;
import wixData from ‘wix-data’ ;
export function button1_click ( event ) {
**let** scope = $w . at ( event . context );
**let** teamMemberRecord = scope ( '#dataset1' ). getCurrentItem ();
wixWindow . openLightbox ( 'Team_Member' , teamMemberRecord );
}
I’ve used this code on the Lightbox page:
Pretty sure the problem is . $w ( “#image1” ). src - used as property for image field but what is the correct form of this code statement??
The image is stored in database field of type Image
import wixWindow from ‘wix-window’ ;
import wixData from ‘wix-data’ ;
$w . onReady (() => {
**let** teamMemberRecord = wixWindow . lightbox . getContext ();
$w ( "#image1" ). src = teamMemberRecord . photo ;
$w ( "#Name" ). text = teamMemberRecord . title ;
$w ( "#Job" ). text = teamMemberRecord . jobTitle ;
$w ( "#Description" ). text = teamMemberRecord . longDescription ;
});