Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8100547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:45:39+00:00 2026-06-05T22:45:39+00:00

In my Phonegap android application dynamically adding list items to jqm listview where on

  • 0

In my Phonegap android application dynamically adding list items to jqm listview where on click on a item ,am taking the item index and passing it to another page to display relative info based on clicked item.It was working fine with jqm v1.0a3 but now i updated to jqm v1.1.0 and now onclick event is not working.Any help?

for(var i=0;i<result.length;i++)
{
 var li=document.createElement("li");
  li.innerHTML="<a onclick='getIndexOfClickedListItem("+i+");'></a><p><b>CustName</b>"+result[i].fields.NAME+</p>";
 ul.appendChild(li);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:45:40+00:00Added an answer on June 5, 2026 at 10:45 pm

    Hiya Please take a look in here (Since I cannot see your full code) working demo using JQM list view http://jsfiddle.net/3RyXz/

    This will add new li as well you can navigate between pages.

    This should help, please let me know if I missing anything.

    Updated Demo

    here with index alert http://jsfiddle.net/RTpqd/14/ (I have added the similar function as you need – getIndexOfClickedListItem 🙂

    Behavior: 1st – click on Add Item link and then click on the foo1 li you will see the correct index value popping up.

    code

    $('.add').click( function(){
        $('#1, #2').append('<li><a onclick="getIndexOfClickedListItem('+count+');"> foo' + count + '</a></li>');
    
        $(this).closest('.ui-content').find('.ui-listview').listview('refresh');
    
        count++;
    });
    

    getIndexOfClickedListItem function here rest demo will make more clear

    //adding click on new list item for index
    function getIndexOfClickedListItem(str){
    
         alert("The clicked list index is ==>" + str);
    }
    

    part of code which does add li

    $('.add').click( function(){
        $('#1, #2').append('<li>' + count + '</li>');
    
        $(this).closest('.ui-content').find('.ui-listview').listview('refresh');
    
        count++;
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an Phonegap & jQuery-Mobile Application for Android. After taking a photo
I have used Android phonegap application for creating dynamic list with label and corresponding
I created dynamic list using android phonegap application.Now I want to add scrollbar for
I have an application developed on iOS & Android using phonegap 1.6.0 & JQM
I am developing my first application in phonegap (android). index.html <!DOCTYPE html> <html> <head>
I'm making an android application using phonegap. I'm using phonegap's Storage api for querying
I'm building an Android application that's based around an enhanced WebView (based on PhoneGap).
I written a android mobile application in JQuery Mobile and PhoneGap in Eclipse. In
I developed an application in the phonegap which is working good in the android
Helo. I am building an application for kids using Phonegap. On Android I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.