See More

Maybe this can help:

I have a project working with a repeat children which expression is:

serverconnect1.data.myarray.top(var1.value)

var1 is a simple variable:
<dmx-value id="var1" dmx-bind:value="15"></dmx-value>

My see more button is:
dmx-on:click="var1.setValue(var1.value+15)

Everything is working fine :slight_smile:

Here is some code to play with:

<body is="dmx-app" id="seemore">
<dmx-serverconnect id="serverconnect1" url="../dmxConnect/api/wapplercommunity/seemore.php"></dmx-serverconnect>
<dmx-value id="var1" dmx-bind:value="15"></dmx-value>

<div class="row" is="dmx-repeat" id="repeat1" dmx-bind:repeat="serverconnect1.data.myarray.top(var1.value)">
<div class="col-12">
<p>The number is {{id}}</p>
</div>
</div>
<div class="row">
<div class="col">
<button id="btn1" class="btn" dmx-on:click="var1.setValue(var1.value+15)">See more</button>
</div>
</div>
<script src="../bootstrap/5/js/bootstrap.bundle.min.js"></script>
</body>

Also you can use:
dmx-hide="((var1.value >= serverconnect1.data.myarray.count()) || serverconnect1.state.executing)"

It seems so simple that it scares me a little, but never had an issue...

PS: Of course, depends on how much data you can load at once, so every case is different...

3 Likes