动态列表视图到详细信息页面(jQuery Mobile的) [英] Dynamic Listview to Details page (Jquery Mobile)

查看:161
本文介绍了动态列表视图到详细信息页面(jQuery Mobile的)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功的从mysql数据库中列出我的数据
在JQM。

i have succeeded in listing my data from mysql database in JQM.

我想列表项链接到其详细信息。

i want to link the list item to its details.

因此​​,当有一个列表上的点击,显示具有所述数据的新页从列表

Therefore when there is a click on a list, a new page with the data from the list is displayed.

我不知道该怎么做了。

继承人什么,我现在有。但链接我的心不是有工作,想我失去了一些东西。

Heres what i have now : but the link i have isnt working, guess i am missing something.

继承人js的上拨弄 http://jsfiddle.net/8WU39/16/

 <script type= text/javascript>
  $('#seyzListPage').live('pageshow', function(){
        $.ajax({
         url: "data.php",
         dataType: 'json',

            success: function(json_results){
            listItems = $('#seyzList').find('ul');
            $.each(json_results.rows, function(key) {
               html = '<li <h3><a href="index1.html?id=' + [json_results.rows[key].airp_id] +'"rel="external">'+json_results.rows[key].airport_code+'</h3>';
              html += '<p><br> Aiport name: '+json_results.rows[key].airport_name+'</p></a></li>';


            listItems.append(html);
            });
            // Need to refresh list after AJAX call
              $('#seyzList ul').listview('refresh');
     $.mobile.pageLoading(true);     
        }
    });
});
  </script>

<div data-role="page" id="seyzListPage">  
    <div data-role="header" id="header">     
  <h1>Airports</h1>    
  </div>

  <div data-role="content"  id="seyzList">
<ul data-role="listview" data-inset="true" data-filter="true"></ul>


  </div>

    <div data-role="footer" data-postion="fixed">
    <h3>Footer</h3>
    </div>


    </div>

我该怎么办获得与它的数据的另一个HTML页面的列表中。

What do i do to get the list linked to its data on another html page.

推荐答案

我有一个非常类似的问题,并发现了一个简单的插件修复。这就是所谓的 jqm.page.params.js 键,可以发现的此处。执行是很容易的。新增插件文件到我的根目录,然后包括它在我的index.html页面的底部。

I had a very similar problem and found a fix with a simple plugin. It's called jqm.page.params.js and can be found here. Implementation was very easy. Added the plugin file to my root directory and then included it at the bottom of my index.html page.

在您的js文件,然后你只想把

In your js file, you then just want to place

 if ($.mobile.pageData && $.mobile.pageData.color){
    var color = $.mobile.pageData.color;
 }

在您的 beforepageshow事件以捕捉上涨到链接变量的顶部。你正在寻找的变量替换'颜色'。

at the top of your beforepageshow event to capture the variables tacked on to the link. Replace 'color' with the variables you are looking for.

这篇关于动态列表视图到详细信息页面(jQuery Mobile的)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆