Hoover on repeater button

:ok_hand:
Seems to be a good idea, but could bring some disatvantages as sideeffect.

@onemoretime
Since you are already a more advanced coder, i would recommend you to evolve your skills even more…

This one you are using directly, yes it is ok (just ok), but for you → JUST-OK ← shouldn’t be enough!!!

 wixData
    .query("LOCALI_COMMERCIALI")
    .find()
    .then((results) => {
      if (results.items.length > 0) {
        const items = results.items;
        $w("#repeater1").data = items;
      }
    });

Instead your intention should be always to keep the following on your mind..

  1. I have always to code as most as possible the dynamic way (avoiding hardcodings)
  2. I should always try to produce reusable code.
  3. My code should always be as much as possible → MODULAR (and again reusable)
  4. I should maybe use → USER-INTERFACES ← to be able to provide my customers a more simple SETUP-SOLUTIONS!

EDIT:
5) Using more → RETURNING FUNCTIONS!

Take a look here…

Maybe your answer now will be → "Oh, i just did not want to spend to much time onto solution → NOT ACCEPTED !!! :upside_down_face:

EDIT: →
Type in → USER-INTERFACE ← into the search of this forum and you will understand…
https://forum.wixstudio.com/search?q=user-interface

2 Likes