Cards going away using paged query

Hello All.
Still having problems with data showing up.

This is the query I am using, seems to be ok when I run it in the web browser it shows the correct data.

these are the bindings I am using.


The data on the screen when I use these query's.

When I change to 3 in the Expression I get this output.

So what am I doing wrong.

Hi Joe,

I will suggest to remove the dmx-data-view card repeat binding first and try by binding directly with the server connect. Once you get it working, then work with the data-view bindings.

Other areas to check:

  1. Opening section html tag is missing
  2. dmx-data-view binding dmx-bind:data="data.data" seems incorrect. It should be a binding to the server connect serverconnectpage_products.
  3. Remove the dmx-param:limit="15" in the server connect. The limit of 15 has been correctly defined in the API.
2 Likes

Hello Guptast. Thanks for the help. I got the card working with all the data using dataview. Then I changed the row to repeat children and the card went away.
Does anyone have any mode good idea's?

Debugged the problem and found that the dataview failed, I redid the the dataview and most everything worked except that it showed all of the items in the database not just 15.
Joe

In one of the screenshots for the Paged Query, the page limit is manually set to 15. Test whether the Paged Query is returning 25 records by replacing the limit with the default $_GET.limit.

Additionally, if you are using a Paged Query, there's not much advantage (if speed is a consideration here) of using a Data View, as the query is already returning a small number of records as per the limit set for each page. Data View is more useful when you are getting a large data set from the server and then want to use pagination etc. on the client side.

Hello Guptast That would work but I filter the query on cat_id, live and featured. So I do not know how to filter on the server connect.

Just add your filters in the query builder, under Conditions.

Thanks

Thanks to all. I have changed to the server connect with conditions. I still get the same problem, that it shows all records. When testing the query it comes back with the correct number of records. The page when seen in browser shows all the remaining records.


this shows how the request is setup, to mee it looks right but as you know I have been know to be wrong.


This is the debug screen all seems to show what it should. The one filter is an error but I can not find which one it is.

here is the rest of the setup.

Also in wappler I only see one card for featured products and one picture for nonfeatured.

I know I have done something wrong but I can not seem to find it.
Joe

The repeat div and binding code seems to be incorrect. Check the example code below for the repeat binding. Replace the bindings with your Server Connect code.

<div class="container-fluid mt-4">
        <div class="row">
            <div class="col-3 d-flex flex-wrap" dmx-repeat:repeat_images="sc_images_paged.data.q_list_images.data">
                <div>
                    <div class="col p-2">
                        <div class="card h-100">
                            <div class="card-image">
                                <img class="card-img-top img-thumbnail" dmx-bind:src="image">
                            </div>
                            <h4 class="card-title">
                                {{description}}
                            </h4>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

As displayed in the browser, with a paged limit set to 10.

Hello Guptast
I looked through my code and saw that the code looks close but mine has more dynamic inputs and CSS.

A nice paragraph

Card image cap

Card title

Some quick example text to build on the card title and make up the bulk of the card's content.

UPC:

810027773173

MSRP:

PRICE:

Add to Cart

Hello All
After rechecking the dynamic parts I have now the correct number of items showing in Wappler. When I check it in the browser I still have the whole data base show up on the page. I have tried to do pagination and trying to follow the old tutorial, I have not been able to work, any newer tutorial for the pagination?

Hi Joe,

My understanding from this post is that you are getting 15 records in Wappler (I'm assuming you're referring to the Server Action / API for the paged query). But in the browser, all the records are showing. This issue indicates that the bindings on the page are incorrect.

If it's a different issue, then please provide further information so that we can assist you in resolving this.

you are correct in your thinking. After changing the bindings I now get the 4 Featured products and 15 of the non featured products and still have a few for a second page.