This article is mainly about JqueryMobile Dynamic generation listView And two methods to achieve refresh are introduced , Friends in need can come here for reference , I hope that's helpful

JqueryMobile Dynamic generation listView And two methods to realize refresh

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('<li><a href="'+results.rows.item(i).name+'">'+results.rows.item(i).name+'</a></li>');
}
$("div[data-role=content] ul").listview('refresh'); // This also works

But here's how it works !

Web page code 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('<li><a href="'+results.rows.item(i).name+'">'+results.rows.item(i).name+'</a></li>');
}
// No listview("refresh") !! for (j = 0; j < len; j++) {
$("#selectmenu").append('<option value="'+results.rows.item(j).id+'">'+results.rows.item(j).name+'</option>');
}
$("#selectmenu").selectmenu('refresh', true); }

JqueryMobile Dynamic generation listView And realize the refresh of the two methods of more related articles

  1. jq Several ways to bind events to dynamically generated tags

    It's often difficult to bind events to dynamically generated tags , My simple test summed up the next , The conclusion is as follows : body> <!-- Here's how to generate tags in a purely dynamic way --> <div id="d2" ...

  2. WPF Data binding , Two ways to refresh the interface -----INotifyPropertyChanged

    .Netformwork4.0 Up to -------INotifyPropertyChanged Namespace : System.ComponentModel Background code public partial c ...

  3. Pull up refresh and pull down refresh ( Including the use of third-party libraries MJRefresh)

    One . Using Apple's native method 1. The drop-down refresh 2. Pull up to refresh (1 First, create a new one footer have to XIB file , Of course, it also includes the corresponding controller file , For example, in XIB In the file, you can drag the corresponding control as follows (2 Then write a real... In the code file ...

  4. iframs Two ways to refresh

    <iframe src="a1.html" id="iframe1Id" name="iframe1Name" width=" ...

  5. Android ListView Two ways to operate

    For example, make a middle part of wechat ( Friend message and other information notification ) The first one is :BaseAdapter() package com.example.wx; import java.util.ArrayList;import ...

  6. Detailed explanation Grunt Plug in LiveReload Realize the automatic refresh of the page ( Two kinds of schemes )

    http://www.jb51.net/article/70415.htm    contain Grunt Series of tutorials This article mainly explains through two kinds of schemes Grunt Plug in LiveReload Realize the automatic refresh of the page , Friends in need can ...

  7. JS Creating elements dynamically ( The two methods )

    Preface There are two ways to create elements 1) The elements that will need to be created , Stitching in the form of strings : Parent element found , Directly on the parent element innnerHTML Assign a value . 2) Use Document.Element Object comes with some functions , To achieve dynamic ...

  8. Jquery Dynamically added elements bind Events 3 Methods

    Suppose we click li label , Pop up his text , If it is added dynamically li, Clicking has no effect , No text at all . The following bloggers share three ways to bind events to dynamically added elements , There are generally two kinds on the Internet , I've added one more here . Case study : ...

  9. C++ call DLL There are two ways —— Static calls and dynamic calls

    C++ call DLL There are two ways —— Static calls and dynamic calls label : dllc++winapinullc 2011-09-09 09:49 11609 Human reading   Comment on (0)  Collection   report   classification : cpp(30)  [ ...

Random recommendation

  1. Introduction to the Service Provider Interfaces-- Official documents

    Address :https://docs.oracle.com/javase/tutorial/sound/SPI-intro.html What Are Services? Services are unit ...

  2. [51 Single chip microcomputer ] With PWM Control DC motor as an example to build a simple 51 Engineering framework

    Catalog 1) Function Overview 2) Pin connection 3) The framework is introduced 4) The module specification 5) Reuse rules 6) Project links 1) Function Overview name : Independent key control DC motor speed regulation Content : The corresponding motor interface needs to be connected to uln2003 Motor control terminal ; ...

  3. No nonsense ExtJs Introductory course 14 [ Text editor :Editor]

    No nonsense ExtJs Introductory course 14 [ Text editor :Editor] extjs Technical communication , Welcome to add group (201926085) ExtJs The built-in editor doesn't have the function of uploading pictures , Most of the time, it can meet our needs . But sometimes this work ...

  4. sqlmap User manual details ( turn )

    http://url/sqlmap/mysql/get_int.php?id=1 When sqlmap This one url When , It will : 1. Judge the injectable parameters 2. You can use that SQL Injection technology to inject 3. Identify ...

  5. No.1__C#

    This is the first one C# Diary of , I've been studying for a week now C# 了 . Because I started to study in my internship , So this time, I'm not allowed to prepare as I did in college , Take the textbook and draw the point , Back concept . This should be a practical course , You should program at the same time , While learning . This is the first time to get to the company ...

  6. enum Use of enumeration

    In the process , We often define constants to identify states , Type, etc . such as Define the status of the order , Can be defined as ORDER_STATUS_CANCEL = 1 Indicates that the order status is " The order has been cancelled ". But it feels like ...

  7. 20 Valid Parentheses( Match bracket )

    The title mean : Judging a string (){}[] Compliance Ideas : With the stack ps: I have been practicing for more than a month , The code won't work , It's not so bad class Solution { public: bool isValid(strin ...

  8. cubieboard To configure WIFI

    1. Install the driver first 2.ifconfig See the name of the wireless card , such as 3. modify /etc/networking/interfaces, To configure wpa-essid Fill in WIFI name wpa-psk Fill in the password 4. ...

  9. Being a Good Boy in Spring Festival( Nimm Game )

    Being a Good Boy in Spring Festival Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 ...

  10. Vue Project template -- and --webpack Automated build tools --- The project is packaged and compressed

    [ First installation node.js]: 1. from node.js Download and install on the official website node, The installation process is simple . 2. npm Version needs to be greater than 3.0, If it's lower than this version, you need to upgrade it : # View version npm -v2.3.0 # l ...