I am pretty sure you were referring to all of this :
Global Scope
A selector with global scope can be used to select any element that is not contained in a repeater. You can also use it to select an element that is contained in a repeater, but you need to understand what that selection means.
When you select an element contained in a repeater from the global scope and you get the value of one of the element’s properties, you receive the value of that element’s property from the repeater’s item template.
For example, here templateText is the text value of the myRepeatedText element from the repeater’s item template.
$w.onReady( function () {
let templateText = $w("#myRepeatedText").text;
} );
When you select an element contained in a repeater from the global scope and you set the value of one of the element’s properties or call one of the element’s functions, the value is set or the function is called on the repeater’s item template and all repeated instances of that element.
For example, here the item template is changed so that “New Text” is the text value of the myRepeatedText element. Also, all existing repeated items have the text value of their myRepeatedText element set to “New Text”.
$w.onReady( function () {
$w("#myRepeatedText").text = "New Text";
} );
And here the item template is changed so that the myRepeatedImage element is hidden. Also, all existing repeated items have their myRepeatedImage element hidden.
$w.onReady( function () {
$w("#myRepeatedImage").hide();
} );
Repeated Item Scope
A selector with repeated item scope selects the instance of a repeating element in the current repeating item and its descendants. You can also use it to select non-repeating elements from the global scope. You cannot change the item template using a selector with repeated item scope.
For example, here when the myRepeatedImage element is clicked, the text value of the myRepeatedText element from the repeated item where the image was clicked is changed to “Selected”. All the other myRepeatedText elements in the other items of the repeater are not affected.
$w.onReady( function () {
$w("#myRepeatedImage").onClick( (event, $w) => {
$w("#myRepeatedText").text = "Selected";
} );
} );
You can restrict a selector with repeated item scope to only select elements from the current repeated items and their descendants, but not elements from the global scope by adding .scoped() to the selector so the function call looks like $w.scoped(“#idToSelect”).
My comments:
The problem I am facing is this and I read the above at least 3 times and thought about what I read, but I am still drawing blank on whether I even get it correctly, I have a feeling what I WAS trying to do earlier is not possible through repeater buttons, each triggering a different url to be iframed on my lightbox. All of above sounds like changes contained within 1 “box” of 1 repeater and I get that, but for code I need to use to have each button trigger a different url on my destination lightbox, I am not sure how to proceed. the iframe is not in the repeater! I know I am sounding really dumb here to those in the know perhaps, but this is the kind of thing I usually get stuck in when it comes to properly understanding how Wix Code works or doesn’t with certain scenarios.
See I am not even eager to try it reading it, this sounds like the $w you spoke of can be manipulated per item, but within the repeater itself. Which means, onclick of my repeater button, can uniquely affect its own box within the repeater,
$w.onReady( function () {
$w("#myRepeatedImage").onClick( (event, $w) => {
$w("#myRepeatedText").text = "Selected";
} );
} );
so let me try it, mixing, hang with me, I am self teaching here lol, dont judge my outloud methods!
import wixWindow from 'wix-window';
export function button47_click(event, $w) {
let testdata={'targetURL':"http://myexternalurltobechangedoniframe"}; wixWindow.openLightbox("BUSINESS CARDS", testdata); }
wait, can it be this simple?
import wixWindow from 'wix-window';
$w("#button47").onClick( (event, $w) => {
let testdata={'targetURL':"http://myexternalurltobechangedoniframe"};
wixWindow.openLightbox("BUSINESS CARDS", testdata); }
Ah, on to editor, I had to expand this conceptually for myself a little bit first since it appears the only problem here is my lack of info and misunderstanding how this stuff works. brb