Need Help Passing Arguments in Wix Code

I need help finalizing this web page:

Functionality A Repeater Page that pulls data from 3 different databases via Reference Fields

1. The Repeater page displays information from  database1 and database2,  that also has an icon that links to a 3rd database thats used for a Dynamic Photo Gallery of the pictures for the item(a car) selected in that line of the repeater.   It also has a "Details button that displays both all information about the items along with the Owners name (data coming from the car registry DB and the membership DB). 

PROBLEM: The Repeater Page proper is correctly displaying each car’s basic details, and the owners basic details. But when I click on the Details button the Lightbox page has no knowledge of the associated car nor owner. I presume will need some Wix Code to pass in the car registry database DashID and Owner Email.

The Dynamic Photo Gallery also has the same problem. It launches but shows ALL the images in the gallery starting at record1, regardless of which car was selected from the repeater. I presume that the same approach to the lightbox would apply here to fix this issue.

Here are some screen shots that show the problem:

  Registry Page 

:camera:

The LIGHTBOX PopUP that should display details about the car selected…

:camera:

  DYNAMIC PHOTO GALLERY... This car shows even if I select the 2nd       Car which is black... 

:camera:

I DID find in wix code, in the Recipies example this snippit of code. After reading the Wix API for databases, I think some variation of getCurrentItem / setCurrentItem would solve the problem but I am unclear how to proceed.

WIX EXAMPLE FROM RECIPES…

export function dynamicDataset_onReady(event) { let foodistaLink = $w(‘#dynamicDataset’).getCurrentItem().linkFromFoodista; $w(‘#foodistaCredit’).html = <p style="font-size:10px; line-height:1.2em; text-align:center"><span style="letter-spacing:0em"> <span style="font-size:10px"><span class="color_11"><span style="font-weight:bold"> Recipe originally published by <span style="font-family:avenir-lt-w01_85-heavy1475544,sans-serif"><a href="${foodistaLink}" target="_blank">Foodista.com</a></span></span></span></span></span></p>; }

Any help is greatly appreciated.
JD

Looks like the embedded screenshots did not work…

REGISTRY PAGE: A Repeater


DETAILS PAGE: A Lightbox from the Details button:

DYNAMIC PHOTO GALLERY:


This is the SIXTH car in the Photo-Registry Database, Dash Number 3241. If I were to Click on the SECOND LINE of the Registry Repeater Page it SHOULD begin the slide show at car#2 Dash# 2995 and stop at car with Dash#3241

I discovered that I had inadvertly added a filter on the Registry DB. Once I removed that the LightBox page displayed the info but it is for the 1st entry in the Registry DB. Again, somehow need to tell the lightbox and photo gallery pages which dash_no from the registry they should be displaying.

BTW: The URL to the Site is: https://jds-cvoa.wixsite.com/cvoa/cv-registry
Click on Review The Registry

Thanks
JD

After thinking about this for a while… I think I need:

  1. While on Registry page… add an on_click function to the Details Icon to getCurrentItem…
  2. On the Details Lightbox… add an on_ready function to setCurretItem

Any takers?

  1. I have added the following code to the Repeater Page for the Details Button:

import wixData from ‘wix-data’;

$w.onReady(function () {
//TODO: write your page related code here…
});

export function button4_onclick(event, $w) {
//Add your code for this event here:
let itemObj = $w(“#dataset1”).getCurrentItemIndex();
}

  1. Then on the Lightbox page that should display the car I added this code:

// For full API documentation, including code examples, visit http://wix.to/94BuAAs

$w.onReady(function () {
//TODO: write your page related code here…
$w(“#dataset1”).setCurrentItemIndex();
});

  1. If I change the setCurrentItemindex(2) it displays info for item 2 in the repeater, if I set it to (3) it shows the infor for item 3. How do I set it to the item number that was clicked from the repeater?

Thanks
JD