10-13-2012 12:10 PM
I started creating client of web app. I want it to have offline cache DB from which can pull data just then user touch button. But then it have to load data from web and reload GUI (Visualization). So is there any framework which will let me do this? I tried knockout.js and backbone but then I reloaded data the page looked like there were no CSS.
Thanks for advices.
10-13-2012 02:54 PM - edited 10-13-2012 03:00 PM
I use Backbone.js to fetch data from the server. It's very convenient and is done with one command: collection.fetch();
Please look at the following simple example, it shows how to fetch data and re-render view with more data. If you have issues deploying it on the device/ripple, let me know and I will assist where I can.
Edit: I just noticed you are referring to BBUI.js, I was able to implement Backbone with BBUI, but I had to re-write the views (gridList, imageList) as Backbone views in order to make it dynamic. My router called bb.pushScreen() when visiting pages. Otherwise, you can use an AJAX request from script tag.
11-26-2012 10:34 AM
Hi! I'm trying to do the same, but I can't make Backbone to work toghether with bbUI.
I can't make it work from onscreenready.
I can create my Backbone views only after ondomready.
Could you please give me some hint on how you rewrote the views as Backbone views?
11-26-2012 10:39 AM
Can you give some code example with this problem?
I just started developing Trello client with backbone: https://github.com/michalkozminski/BB10_Trello-bac
so you can have a look on my code.
11-26-2012 12:45 PM
Thank you very much for the quick reply.
Looking at your code, I've seen that you don't use the onscreenready function inside bb.init() in your index.html page.
So you are editing the html code of your views AFTER those have been attached to the DOM?
Shouldn't we better render the html in the onscreenready function?