Going crazy over onItemClick

I am a brand new coder. I have looked at the documentation for onItemClick and am a complete loss as to why the following code generates the error:

Property ‘onItemReady’ does not exist on type ‘Box’

$w . onReady ( function () {
wixData . query ( “TrekGolfTrivia” )
. find ()
. then ( res => {
quizQuestions = res.items ;
quizQuestions = shuffle ( quizQuestions );
quizQuestions = quizQuestions . slice ( 0 , 9 );
$w ( “#quizRepeater” ). onItemReady ( displayQuestions );
$w ( “#quizRepeater” ). data = quizQuestions ;

It should be noted that there is a repeater on the page that it correctly named. Someone please help me. :slightly_smiling_face:

I don’t see any click event handler in the code you posted.
I only see an onItemReady handler (that is used wrong).
Please elaborate regarding what you’re trying to do.

I’m attempting to move data from my collection to the buttons on my repeater. The buttons are used to allow a user to select one of four choices, then the rest works. My use of the onItemReady produces a “function can’t be applied to a box” error.

I should also note that there are click event handlers outside of the realm of this code block.

…click event handlers outside of the realm of this code block…
And this is exactly your failure. Your code looks wrong.

Try to do it like the following example…

$w.onReady(function () {  
	.then(res => {       
		quizQuestions = res.items;       
		quizQuestions = shuffle(quizQuestions);      
		 quizQuestions = quizQuestions.slice(0, 9);              			
		$w("#quizRepeater").data = quizQuestions;     
	$w("#quizRepeater").onItemReady(($i, iData, index)=>{

… you do not show the rest of your code, so it is not clear what else you have in your function.