Yes, the problem is as you described. Mobilization starts when the document is ready. But since your offline database queries are asynchronous, they end after document.ready is started. Thus, the DOM is updated later in the process and does not add additional CSS for all sections and list items.
I think you will have to change the source of mobile js so that it does not work on the document, but it starts when you tell it to start. Then you have to call this function in the database callback.
This seems to be the only option at the moment.
Traditionally, I used jqtouch and now sencha. I have not played much with jQuery mobile.
ALTERNATIVELY - you can write your HTML after requesting it from a database with the necessary CSS styles. If you use the Firebug plugin for Firefox, you can see what styles / classes are applied when the mobilization works. You can simply write your HTML using these conventions. Not perfect, but will work.
Ryan Doom Oct 28 '10 at 4:01 2010-10-28 04:01
source share