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 8441235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:30:56+00:00 2026-06-10T08:30:56+00:00

I am adding a listview with list items to a jQuery mobile collapsible grid.

  • 0

I am adding a listview with list items to a jQuery mobile collapsible grid. Here is my Default.js code

$(document).ready(function () {


    var appNames = getApprovalNames(phone, pin);

    for (var i = 0; i < appNames.length; i++) {

        var header = '<h3>' + appNames[i].Name + '</h3>';

        var ulHeader = '<ul data-role="listview" id="myAppsSectionGridTable">';

        var approvals = getApprovalInformation(phone, pin, appNames[i].Name);

        var listArray = new Array();


        for (var j; j < approvals.length; j++) {

            var link = '<li><a href="' + 'NickData' + '"' + '><img src="';
            var detailHeader = '" alt="" class="ui-li-icon"/>' + '<h3>' + 'NickData' + '</h3>';
            var detail = '<p>' + 'NickData' + '</p>' + '</a>' + '</li>';

            var list_item = link + detailHeader + detail;

            listArray.push(list_item);

        }

     var entire_list = null;

     for (var y in listArray) {

        entire_list = entire_list + listArray[y];

    }

    $('#accMain').append(header + ulHeader + entire_list + '</ul>');

    }   

});

This code displays the data on the screen but with no jQuery mobile css anywhere on the screen. Also when I look at it in the source, I do not see my newly created markup in there. Am I adding this in the wrong event or something? If I just hardcode the markup in the page everything works fine. Its something to do with dynamically adding jQuery mobile markup.

<asp:Content ID="HContent" ContentPlaceHolderID="HeadContent" runat="server">

<script src="Js/Pages/Default.js" type="text/javascript"></script>

</asp:Content>
<asp:Content ID="THContent" ContentPlaceHolderID="TopHeaderContent" runat="server">
    <h1>
        Applications</h1>
</asp:Content>
<asp:Content ID="MContent" ContentPlaceHolderID="MainContent" runat="server">

 <div id="accMain" data-role="collapsible" data-inset="false" data-collapsed="false">

 </div>

</asp:Content>

This master page body for this is..

<body>

<div data-role="page" data-theme="b">

    <div data-role="header" data-position="fixed">

         <asp:ContentPlaceHolder ID="TopHeaderContent" runat="server"></asp:ContentPlaceHolder>


    </div><!-- /header -->

    <div data-role="content">   

 <asp:ContentPlaceHolder ID="MainContent" runat="server"></asp:ContentPlaceHolder>

    </div><!-- /content -->

    <div data-role="footer" data-position="fixed">
    <asp:ContentPlaceHolder ID="FooterContent" runat="server"></asp:ContentPlaceHolder>


    </div><!-- /footer -->

</div><!-- /page -->

</body>
  • 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-10T08:30:58+00:00Added an answer on June 10, 2026 at 8:30 am

    You need to call the listview method

    $('#mylist').listview()
    

    If you are just adding content to an existing listview then call the refresh method

    $('#mylist').listview('refresh');
    

    Sometime you may need to call it in your pageshow event, something like the following

     $('#myPage').on('pageshow', function() {
         try 
        {
           $('#mylist').listview('refresh');
        } catch (e) {
         $('#mylist').listview();
        }
    });
    

    If you are adding multiple widgets/items that need to be enhanced then you can try triggering the create event

    $('#myPage').trigger('create');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my Phonegap android application dynamically adding list items to jqm listview where on
I am generating and adding list items dynamically by parsing xml data. Code looks
I'd like to move items from one list view to another. adding them to
I have problem adding arraylist to list view, will explain about my problem here..
I'm displaying a list of items in a WPF ListView, the items have a
I have implemented an adapter for my ListView which extends BaseAdapter. My list items
Okay, how do I programmatically add items from an List<ListViewItem.ListViewSubItem> to an ListView ?
I have a Checked ListView with a few items in it. Here's just a
I have a listview and I am using list.add(mylist) and adapter.notifydatasetchanged() ,its adding the
I was thinking of adding an icon to the items in a ListView who

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.