Repeater example code

TL;DR: give us some worked out examples to populate a Repeater in code.

I wanted to replace my tables with the new Repeater. “Shouldn´t be too difficult”, I thought. “Replace the .rows with .data and done.” That turned out not to be the case. So on my Sunday afternoon I started reading the documentation. And then you discover gems like this:
“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.”
It reminded me of my days back at University, where my fellow students used to slam me with quotes from Lenin: I understood every single word used, but strung together like he did, its meaning was lost on me. Fortunately, I later discovered that it was all meaningless to begin with.
Do not deduce from this that I accuse Wix of trying to put a veil over our eyes. There´s another possibility: that the documentation is a bit too Spartan, too haphazard; crystal clear to the developers, but laden with incomprehensible, metaphysical formulae to the mere mortal.
This having said, could I kindly request Wix to embark on an endeavour which has as its object to enlighten us, the binary uninstructed, about the inner secrets of that beautiful beast you created, in such a way that can do what we do best: copy and paste learn by example.
Myself, I would greatly appreciate a worked out example of populating a Repeater without a dataset, all in code, so we can all rejoice and repeat “The truth has been revealed, Wixazustra has come down from the mountain.”
Enjoy what´s left of this Sunday,
Giri

6 Likes

Hi Giri,
How are you? :slight_smile:
You can check out the first step I mentioned in the correspondence here .
Basically, after setting the data to the repeater, you should use the onItemReady function in order to set the information to the relevant element.

Good luck!
Tal,

Thank you, Tal, I searched the forum before I wrote the above, but I missed that one.