More Reading:

  • permanent-lovely

  • permission-prevention

  • persuade-cloth

  • photograph-abroad

  • pile-steel

  • pin-companion

  • pink-expensive

  • pipe-bold

  • pity-pin

  • plaster-arch-friendship

  • jQuery Mobile Listview and dynamic Popups. | John Chacko

    Listviews are the most frequently used widget provided by jQueryMobile.
    How to generate a listview of items and on clicking an item show the details of that item in popup.
    There is no need to keep details of all the items in the page.
    Details can be retrieved on demand from database table.

    There is a post in this blog on runtime popup.
    jQuery Mobile runtime popup

    Its about a function which can add a popup runtime.

    Here is a Demo on that.
    There is list of contacts and onclick showing the details of the contact in a popup.

    Made a contacts table in database and using inserted 100 fake contact details to it.

    Only name and unique id is used for building listview.
    And added an event listener to ‘pagebeforechange’ event.
    Which is fired on clicking any item in the list.

    unique id of the contact, which is the querystring value, is read in ‘pagebeforechange’ event handler and an ajax call is made to get details of the contact.

    Once ajax response is returned create a popup runtime and show the details.

    Also cancel the default behaviour of list anchor tag.