Developer forum

Forum » Rapido » Error with "Load more" button

Error with "Load more" button

Aki Ruuskanen
Aki Ruuskanen
Reply

 

Hi,

Rapido 2.0.

I'm getting this script error when clicking the "Load more" button. I thought first that it had something to do with our own templates but I get I even though I go back to the standard Rapido-templates. Any ideas?

 

master.js:1308 Uncaught TypeError: Cannot read property 'push' of undefined
    at HandlebarsBolt.AddToCache (master.js:1308)
    at XMLHttpRequest.s.onreadystatechange (master.js:1138)
HandlebarsBolt.AddToCache @ master.js:1308
s.onreadystatechange @ master.js:1138
XMLHttpRequest.send (async)
HandlebarsBolt.UpdateContent @ master.js:1151
HandlebarsBolt.AddContent @ master.js:1164
LoadMore.Next @ master.js:1489
onclick @ alla-tyger:1

 

Regards / Aki


Replies

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Added a temporary fix by basically check the "cache[id]" for "undefined" before doing the push.

HandlebarsBolt.prototype.AddToCache = function (data, id) {
    for (var i = 0; i < data.length; i++) {
        if (cache[id]!=undefined) {
            cache[id].push(data[i]);
        }        
    }
}
 
Karsten Thuen Dynamicweb Employee
Karsten Thuen
Reply

Hi Aki

It is a little hard to know what has happened only looking at the error and not the page. But, while on the product list page, you could open the console, go to the console tab, the write "cache" and hit enter. This should render what is currently in the cache. And it should look like a little this: 

{ProductsContainer: Array(30), Product1: Array(1), hideHelpText1: null, unitName1: null, unitId1: null, …} 

Have you made changes in either the ProductListFeed.cshtml or ProductsRender.cshtml?

 

Best regards
Karsten Thuen

 

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

Thanks, I'll check the cache. 

I have made my own feed and render but I got the same error when I switched to the original feed and renderer. 

Regards / Aki

 

You must be logged in to post in the forum