Jquery移动Jsonp从Listview到DetailsPage小提琴包括在内

[英]Jquery Mobile Jsonp from Listview to DetailsPage fiddle included


iam working on a Jquery Mobile Listview that gets Data CrossBrowsed Dynamicly from a .json File.

我正在开发Jquery Mobile Listview,它可以从.json文件中动态浏览数据。

This Part works fine for me... now i want to display the DetailsPage from an Listview entry but cant get it working...

这部分对我来说还行……现在我想从Listview条目中显示详细说明,但是无法使它正常工作……

Need some help to get this working... my Brain stucks ...

需要一些帮助来让这个工作……我的大脑了…

Here is my JsFiddle

这是我JsFiddle

jsfiddle.net/masterluke/NbaZ6/

jsfiddle.net/masterluke/NbaZ6/

2 个解决方案

#1


0  

It looks like your transition to the Details page is working correctly but you're not sure how to populate the page with the data from the listview.

看起来您对Details页面的转换是正确的,但是您不确定如何使用来自listview的数据填充页面。

Check out this fiddle: http://jsfiddle.net/rfF3j/1/

看看这个小提琴:http://jsfiddle.net/rfF3j/1/。

When it's rendering the data it does a few things differently:

当它呈现数据时,它做了一些不同的事情:

  1. It stashes all the data in the dataStore object, keyed by item.id.
  2. 它将所有数据存储在dataStore对象中,由item.id键控。
  3. It attaches the item.id to the newly created row by using the .jqmData function.
  4. 它高度的项目。通过使用. jqmdata函数将id标识到新创建的行。
  5. Creates a click handler on the row that, when clicked:
    1. Gets the item-id from the row.
    2. 从行获取项id。
    3. Uses that to find the item from dataStore.
    4. 使用它从数据存储中查找项。
    5. Populates the Details page with the item data.
    6. 用项数据填充Details页面。
  6. 在单击时在该行上创建一个单击处理程序:从该行获取itemid。使用它从数据存储中查找项。用项数据填充Details页面。

Given, this isn't the best way to store your data but it's an example of the fact that you'll want to keep it around somewhere so you can reuse it later.

这并不是存储数据的最佳方式,但它是一个示例,说明您希望将数据保存在某个地方,以便以后重用。

#2


0  

Ohhh sorry for my stupid Question ( my Brain was Codefrozen), i solved my problem with ajax="false" but this was not the best Solution for me but its Ok for this small WebApp...

哦,对不起我的问题(我的大脑是Codefrozen),我用ajax="false"解决了我的问题,但这对我来说不是最好的解决方案,但对于这个小型的web应用来说是可以的……

I have also another Question to you or others about Jsonp! I want to filter Results by Category "Objects" and Display the Arrays in Listviews only for Specified Categorys on Link click Here is my JsonP file ...

我还有一个关于Jsonp的问题要问你或其他人。我想要根据类别“对象”筛选结果,并在listview中显示数组,只在链接点上指定的类别是我的JsonP文件…

Full JsonPCode on Fiddle

完整JsonPCode小提琴

        "id":"4",
    "name":"Marilyn",
    "slogan":"Essen&Trinken",
    "beschreibung":"diverse Leckereien in Verbindung mit einem in Einzelbrühung hergestellten Kaffee",
    "images":["http://bistro.de/427428_363474813673251_1907009930_n.jpg"],
    "offen1":"Di-So ab 11 Uhr",
    "offen2":"Montag Ruhetag",
    "offen3":"",
    "homepage":"http://",
    "strasse":"Am Markt 36",
    "ort":"hometown",
    "telefon":"tel: 1234242888193",
    "google":"http://.de"
}
智能推荐

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2013/03/27/54dac1535e559bee5a44ead71e993d72.html



 
© 2014-2019 ITdaan.com 粤ICP备14056181号  

赞助商广告