Monaca Onsen UI Discord Chat Github Repo

Backbone JS rendering twice



  • I am working on an app using Backbone JS, and I’m experiencing a problem, whereby the app fires render twice on collection read.

    The app displays fictitious “company profiles”, whose data is provided by this JSON file.

    I used the Bootstrapping approach to have the data available when rendering the page.

    When you run the app, it displays the first company profile, and you can go to the next one on leftswipe. Similarly, you can display the previous one on rightswipe. Well, at least this is what is supposed to happen, but 😞 … see what’s actually happening below

    Cordova Backbone App Demo -- Multiple Rendering Problem

    The code is on Github. I Need help in fixing the problem of the app rendering twice, which results in “skipping” one item when swiping, as seen in the GIF above. Thanks.



  • I have since fixed the problem and updated the code and GIF, thanks to this answer on stackoverflow and this other answer, also from stackoverflow. 😎