3

I have started using jQuery Mobile and I am trying to understand how I should handle clicks and passing data around. For example, I have a listview of items. When tapped, I want to take the user to another page within the app that is generated based on the item ID that was clicked. Would I store the data ID in a custom data-* attribute and bind a click event to it so I can send them to the other page? Or is there a native approach or a 3rd party library I should be using? I am using a REST service, but the underlying backend is an ASP.NET MVC application if that makes a difference. Any help or advice would be greatly appreciated.

4

2 に答える 2

2

jQueryMobileではなくSenchaTouchを使用しました。しかし、Sencha Touchは、解決しようとしている問題の名前であるルーティングを適切にサポートします。クライアント側とサーバー側のどちらでルーティングを行うかを慎重に検討する必要があります。Sencha Touchはクライアント側をサポートします。これは、優れたオフライン動作に役立つため、より一般的なアプローチになりつつあります。jQuery Mobileは、私が読んだものからおそらく不完全なルーティングサポートを持っていますが、Backboneなどの他のライブラリはギャップを埋めることができます。Spine、Thoraxも参照してください。Spineは、モバイルルーティングのために私に特に推奨されました。 このサイトは、ルーティングを改善するためのjQueryへのパッチを提案しています。

于 2012-08-07T15:13:13.000 に答える