Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使jquery搜索与动态列表视图一起工作?_Jquery_Mobile - Fatal编程技术网

如何使jquery搜索与动态列表视图一起工作?

如何使jquery搜索与动态列表视图一起工作?,jquery,mobile,Jquery,Mobile,我正在尝试在listview上使用data filter=“true”功能。我发现它只适用于静态列表(即,所有li元素都列在html文件中)。对于动态生成的列表,它不起作用。似乎需要以某种方式重新初始化。以下是我尝试过的: <!DOCTYPE html> <html> <head> <title>View Events</title> <meta http-equiv="Content-Type" content="text/ht

我正在尝试在listview上使用data filter=“true”功能。我发现它只适用于静态列表(即,所有li元素都列在html文件中)。对于动态生成的列表,它不起作用。似乎需要以某种方式重新初始化。以下是我尝试过的:

<!DOCTYPE html>
<html>
<head>
<title>View Events</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet"
  href="script/jquery.mobile-1.1.0/jquery.mobile-1.1.0.min.css" />
<script type="text/javascript" src="script/jquery-1.7.2.min.js"></script>
<script type="text/javascript"
  src="script/jquery.mobile-1.1.0/jquery.mobile-1.1.0.min.js"></script>
<script type="text/javascript" src="script/pure_min.js"></script>
</head>
<body>
  <div data-role="page" id="view-events">
    <div data-role="header" data-id="header" data-position="fixed">
      <h3>
        View Events of <span id="events-for-pump-id" class="pump-id">...</span>
      </h3>
    </div>
    <div data-role="content">
      <ul id="events" data-role="listview" style="display: none;" data-filter="true">
        <li class="events code"></li>
      </ul>
    </div>
    <script type="text/javascript">
                    $(document).on('pageinit', '#view-events', function() {

                        $('#events-for-pump-id').autoRender({
                            'pump-id' : 123
                        });
                        $('#events').autoRender({
                            events : [ {
                                code : 1
                            }, {
                                code : 2
                            }, {
                                code : 3
                            } ]
                        });

                        $('#events').show();
                    });
                </script>
  </div>
</body>
</html>

查看事件
查看。。。
$(文档).on('pageinit','#view events',function(){ $(“#泵id事件”).autoRender({ “泵id”:123 }); $(“#事件”).autoRender({ 活动:[{ 代码:1 }, { 代码:2 }, { 代码:3 } ] }); $(“#事件”).show(); });
我在谷歌上偶然发现了这个,你查过了吗