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

  • SEARCH
  • Home
  • 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 8582219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:14:20+00:00 2026-06-11T21:14:20+00:00

Getting a strange issue. It seems to be a bug. Am adding List items

  • 0

Getting a strange issue. It seems to be a bug.

Am adding List items with Nested list, dynamically in a Jquery mobile List.
Now- clicking on the New List item- opens the New Nested List, but also its showing- previous nested list item (the Last Nested List item before adding the New).

Here is the Fiddle-

http://jsfiddle.net/codenameavi/qSrfv/13/

[Use the Browser Back button to navigate between Nested and Main List in the fiddle]

Adding dynamically with this code-

$("#addBttn").click(function() {

      // adding a LI with Nested List in Main List
      var li = '<li data-icon="false" data-theme="a"><a>NEW ITEM</a>'

                 + '<ul data-role="listview" data-inset="true" data-theme="h" data-dividertheme="a">'
                     + '<li data-icon="false" data-theme="b">'
                     + '<a>NEW ITEM 1</a></li>'
                     + '<li data-icon="false" data-theme="b">'
                     + '<a>NEW ITEM 2</a></li>'          
                 + '</ul>'

               + '</li>';

    $("#newsListContent").append(li).trigger('create');
    $("#newsListContent").listview('refresh');
});

EDIT

Yes its a bug. Issue just reported- https://github.com/jquery/jquery-mobile/issues/5098

The bug is there in latest version too.

  • 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-11T21:14:21+00:00Added an answer on June 11, 2026 at 9:14 pm

    Try this, it works :
    EDIT:

    var i=1;
    $('#addBttn').click(function() {
    
         // adding a LI with Nested List in Main List
         var li = '<li data-icon="false" data-theme="a">NEW '+i+'</li>';
         $('#newsListContent').append(li);
    
        var ul = '<ul data-role="listview" data-inset="true" data-theme="h" data-dividertheme="a" id="ul_'+i+'">'
                         + '<li data-icon="false" data-theme="b">'
                         + 'NEW ITEM '+i+'</li>'
                         + '<li data-icon="false" data-theme="b">'
                         + 'NEW ITEM '+i+'</li>'          
                     + '</ul>';   
        $('#newsListContent li:last').append(ul).trigger('create');
    
        $('#newsListContent').listview('refresh');
    
        i++;
    });
    

    http://jsfiddle.net/ouadie/prZ9a/1/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are facing a strange issue while sending email. It seems that the new
I am getting strange behaviour using the built-in C# List.Sort function with a custom
I am facing strange issue i am getting string from database and comparing with
I'm having a strange issue with getting my GridView - RowDataBound method to compile.
I'm facing very strange issue, I'm getting JSON object from django powered site and
I'm having some issue getting what seems like a fairly straight-forward problem solved in
I am getting strange errors while trying to create a simple database using isql
Hi I'm getting strange feedback from the feedback sandbox server. Actually there should be
I'm getting strange error 'int' object has no attribute 'startswith' I haven't used the
When I'm writing to the serial interface, I'm getting strange and unexpected output when

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.