Hi,
I’m trying to debug a page code where getCurrentItem() of dataset is invoked after repeater item is clicked.
I’m using the Chrome JS debugger but I’m not able to view the result value of getCurrentItem() although it does get logged using console.log().
I’m trying to understand why does it behaves like this, I set the result of the getCurrentItem() into a JavaScript regular variable so why is it not showing any value?
BTW - I’m able to set a breakpoint to the clickedItemData line as well.
The code is:
// API Reference: https://www.wix.com/corvid/reference
// “Hello, World!” Example: https://www.wix.com/corvid/hello-world
$w.onReady( function () {
// Write your JavaScript here
// To select an element by ID use: $w(“#elementID”)
// Click “Preview” to run your code
console.log( “on ready” );
});
export function container3_click(event) {
// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
// Add your code for this event here:
debugger ;
let $item = $w.at(event.context);
let clickedItemData = $item( “#dataset1” ).getCurrentItem();
console.log( "clicked " + JSON.stringify(clickedItemData));
}
Attached the screenshot of the Chrome debugger.