facebook

MobiOne <-> PHP <-> MySQL

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 4 posts - 31 through 34 (of 34 total)
  • Author
    Posts
  • #314595 Reply

    iElyos
    Member

    Wayne,
    it’s working fine for me!
    thanks for this!

    iElyos

    #314826 Reply

    DenisField
    Member

    I have created a similar page to the twitter example (using JSP) to display a dynamic list but if I try and add a link (> at end of list item) using the generated html for the listitem as a template nothing happens when I select the link running on an iPhone.

    In the created .js file there is a call to getElementFromID using the id for the image used for the link this will not work as the id will be repeated for each line in the list.

    What do I need to do to get the link to function and how can I pass extra parameters to the page that will be different for each list line.

    #314830 Reply

    support-michael
    Keymaster

    @DenisField
    Here is a slightly revised snippet provided Vadim on the dev team. It uses unique IDs and attaches a general onclick handler for all list-items.

    
      $.each(tweets, function(i, tweet){
           $('#m1-twitter-result-list1').append(
              '<li id="m1-twitter-result-listItem1-' + i + '" class="' + 
                    (i == 0 ? 'm1-first ' : "") + 
                    (i == (tweets.length - 1) ? 'm1-last ' : "") + ' m1-twitter-list-item">' +
                  '<div id="m1-twitter-result-text2" class="twitter-post m1-text">' +
                     tweet.text +
                  '</div>' +
                     '<img id="m1-twitter-result-image1" src="' + 
                        tweet.user.profile_image_url  +
                    '"/>' + 
               '</li>');
      });
    
      //general click hander for list-items
      $('.m1-twitter-list-item').click(function(e) {
        alert("Clicked text: " + $(e.target).text());
      })
    

    Wayne
    Genuitec Mobile Team

    #314859 Reply

    DenisField
    Member

    Thanks Wayne

    This looks like it will do what I need.

Viewing 4 posts - 31 through 34 (of 34 total)
Reply To: MobiOne <-> PHP <-> MySQL

You must be logged in to post in the forum log in