# Pass Dynamic Pro Gallery Dataset Item to Lightbox

**URL:** <https://forum.wixstudio.com/t/pass-dynamic-pro-gallery-dataset-item-to-lightbox/36613>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [June 14, 2018, 7:45pm UTC](https://forum.wixstudio.com/t/pass-dynamic-pro-gallery-dataset-item-to-lightbox/36613 "2018-06-14T19:45:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kurtsuchomel](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/kurtsuchomel/32/4886_2.png) [@kurtsuchomel](https://forum.wixstudio.com/u/kurtsuchomel)\
**Post date:** [June 14, 2018, 7:45pm UTC](https://forum.wixstudio.com/t/pass-dynamic-pro-gallery-dataset-item-to-lightbox/36613/1 "2018-06-14T19:45:57Z")

</div>

Hi. I have a dynamic Wix Pro Gallery that is setup and working correctly with a dataset (1 row per gallery item). The Gallery is also setup with additional filter buttons and this all works correctly.

I want to open a lightbox and pass the context object to display more information…essentially treat the lightbox as a template with fields to display based on the passed row data (context object).

```javascript
$w.onReady(function () {
    console.log("--- Portfolio page ready");
    updateNav("#buttonAd"); // custom filter buttons

    $w("#datasetPortfolio").onReady( () => {
	console.log("--- datasetPortfolio onReady");

	currentItem = $w("#datasetPortfolio").getCurrentItem();
	currentIndex = $w("#datasetPortfolio").getCurrentItemIndex();

	$w("#portfolioGallery").onItemClicked( (event, $w) => {
	    console.log("Gallery: item clicked!");		
	    console.log(" item title = " + event.item.title);		
	    wixWindow.openLightbox("PortfolioLightbox", event.context);
	} );

    });

});

```

The above code works up until I call the lightbox.

The lightbox appears, but the “event.context” is null. The problem I have is that the context is not updated. How do I get the related row data object of the selected gallery image item? I’ve searched the forums and have not found an answer.

I’ve also tried using the variable currentItem, but that only uses the first item in the filtered gallery items.

I’m sure someone must have come across this issue, but I can’t find the answer in the forum.

And while we’re at it I would like to request dynamic lightboxes, so they can appear in link area for datasets and elements!

Thanks!

---

<div class="post-metadata">

**Author:** ![kurtsuchomel](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/kurtsuchomel/32/4886_2.png) [@kurtsuchomel](https://forum.wixstudio.com/u/kurtsuchomel)\
**Post date:** [June 22, 2018, 7:23pm UTC](https://forum.wixstudio.com/t/pass-dynamic-pro-gallery-dataset-item-to-lightbox/36613/2 "2018-06-22T19:23:22Z")

</div>

So no reply yet and Wix Customer Support says they do not support Wix Code Issues so post to the forum. I fully expect a Wix Code Support person to be quickly fielding these questions! If not, then a feel Wix will lose customers to Squarspace and Wordpress. You have a great product, but a broad range of customers need prompt answers! Thanks!

---

<div class="post-metadata">

**Author:** ![cfofirsteliteltd](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/cfofirsteliteltd/32/5119_2.png) [@cfofirsteliteltd](https://forum.wixstudio.com/u/cfofirsteliteltd)\
**Post date:** [June 23, 2018, 12:52am UTC](https://forum.wixstudio.com/t/pass-dynamic-pro-gallery-dataset-item-to-lightbox/36613/3 "2018-06-23T00:52:54Z")

</div>

This would be great to know. I am trying to implement the exact thing.

---

<div class="post-metadata">

**Author:** ![roi-bendet](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/roi-bendet/32/1283_2.png) [@roi-bendet](https://forum.wixstudio.com/u/roi-bendet)\
**Post date:** [June 24, 2018, 12:34pm UTC](https://forum.wixstudio.com/t/pass-dynamic-pro-gallery-dataset-item-to-lightbox/36613/4 "2018-06-24T12:34:06Z")

</div>

Hi,  
Is this code running?  
console.log(“Gallery: item clicked!”);  
Roi.

---

<div class="post-metadata">

**Author:** ![kurtsuchomel](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/kurtsuchomel/32/4886_2.png) [@kurtsuchomel](https://forum.wixstudio.com/u/kurtsuchomel)\
**Post date:** [June 24, 2018, 1:15pm UTC](https://forum.wixstudio.com/t/pass-dynamic-pro-gallery-dataset-item-to-lightbox/36613/5 "2018-06-24T13:15:23Z")

</div>

Yes, but the event.context in the next line of code: wixWindow.openLightbox(“PortfolioLightbox”, **event.context** ); does not contain the current row data I need.

---

<div class="post-metadata">

**Author:** ![roi-bendet](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/roi-bendet/32/1283_2.png) [@roi-bendet](https://forum.wixstudio.com/u/roi-bendet)\
**Post date:** [June 24, 2018, 1:47pm UTC](https://forum.wixstudio.com/t/pass-dynamic-pro-gallery-dataset-item-to-lightbox/36613/6 "2018-06-24T13:47:07Z")

</div>

Can you please share a link to your site and specify the name of the page so we can inspect?  
Roi.
