ui class not working at second loading page | PhoneGap x jquerymobile
・ページキャッシュが利用されるとき? ui class が反映されなかった。
一度目は大丈夫だけど、戻る→進むで表示するとclassが反映されない。
生成したDOMに、jquerymobileが ui-クラスをつけてくれるタイミングがわからない。
http://jquerymobile.com/demos/1.0.1/docs/lists/docs-lists.html
Updating lists
If you add items to a listview, you’ll need to call the refresh() method on it to update the styles and create any nested lists that are added. For example:
If you add items to a listview, you’ll need to call the refresh() method on it to update the styles and create any nested lists that are added. For example:
$(‘#mylist’).listview(‘refresh’);
これでいけるみたいだけど、listview()がありませんといわれる。
changepageしたあとに
$(‘ul#list-result’).listview(‘refresh’);
で大丈夫でした。タイミングが難しいですね。
.page() functionを呼ぶ方法もありそうです。