Hi
Im using the content manager to create our products range to select through the product from range → materials → shape → size → item
Im stuck at here for connecting to item dynamic page (wavebox item page) from selecting list at dropdown menu.
I will really much appreciate. Thanks
When you use an element inside a repeater you can not simply code it the same way as using it on a page itself.
First off, see the Wix Support page abut repeaters so that you know what can and what can’t be used with them.
https://support.wix.com/en/article/elements-that-cant-be-added-to-repeaters
See here for working with repeaters in code.
https://www.wix.com/corvid/reference/$w.Repeater.html
Also, see this example here about working with elements in a repeater (inline actions) and outside of a repeater (global actions).
https://www.wix.com/corvid/forum/corvid-tips-and-updates/example-input-repeaters
If you want to add your own dropdown options within code itself, then you can do something like this.
$w("#repeater").data = myData;
$w("#repeater").forEachItem( async ($item, itemData, index) => {
//Set dropdown options
$item("#myDropdownList").options = [
{"label": "Hide", "value": "hide"},
{"label": "Delete", "value": "delete"},
{"label": "Test", "value": "test"}
];
})
//Create an onChange event for this dropdown list. Check the arguments: event, $w
export function myDropdownList_change(event, $w) {
let itemId = event.context.itemId;
let myAction = $w("#ddlPostOptions").value;
myFunction(itemID, myAction);
}
//Do whatever you like for this item of repeater based on ddl selection
function myFunction(itemID, actionType) {
console.log("We will " + actionType + " repeater item" + itemID);