Home > Web Front-end > JS Tutorial > body text

Two methods for JqueryMobile to dynamically generate listView and implement refresh_jquery

WBOY
Release: 2016-05-16 16:56:59
Original
1255 people have browsed it

Two methods for JqueryMobile to dynamically generate listView and implement refresh

Copy code The code is as follows:

function queryEntfernungen(tx, results)
alert("This Hello works");
var len = results.rows.length;
// This For works fine

for (var i = 0; i < len; i ) {
$("div[data-role=content] ul").append('

  • ' results.rows.item(i).name '
  • ');
    }
    $("div [data-role=content] ul").listview('refresh'); // This also works


    But the following method can also succeed!
    Copy code The code is as follows:

    function query(tx, results) {

    var len = results.rows.length, i, j;

    for (i = 0; i < len; i ) {
    $("div[data-role=content] ul").append('

  • ' results.rows.item(i).name '< ;/li>');
    }
    // No listview("refresh") !!

    for (j = 0; j < len; j ) {
    $("#selectmenu").append('');
    }
    $("#selectmenu").selectmenu('refresh', true);

    }

  • Related labels:
    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template