VyTcdc VyTcdc - 1 year ago 169
Android Question

Dynamic listview to Details view page in Jquery mobile

I have manage to create an Dynamic listview in Json but I want to do details view when I click that listview in Jquery mobile,When I click that Dynamic list I want to get more details about that list.

Jquery code


//if ( i == 4 ) return false;



function movielist(item)

return "<li><a href='#pageone2'>"+item.title+"</a></li>";


Html Code :

//Page 1
<div data-role="page" id="pageone" data-theme="b">
<div data-role="header">
<div class="custom_header">
<h1>Welcome To My Homepage</h1>
<div class="custom_main">
<p style="color:white">Welcome!</p>
<div data-role="content">
<ul data-role="listview" data-inset="true" id="images" >
<br> <br>
<a href="#pageone2" data-transition="flip" data-role="button">Go</a>
<div data-role="footer" data-position="fixed">
<div class="custom_footer">
<h1>Footer Text</h1>

Answer Source

Use event delegation to add a click handler on dynamically created dom elements:

$("#images").on("click", "li a", function(e){
    //code to show details goes here
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download