Wednesday 15 June 2011

jquery - listview link work only for the first items -


I have a weird problem using the data-role = "listview" display JSON list. Only the first items that are displayed on the working of the Android screen link, the other items that return to the first items I am using jquerymbile 1.3.1 I tried:

  overflow: book ; -Widk-overflow-scrolling: touch;   

and

  & lt; Script & gt; $ (Document) .bund ("mobileinit", function () {$ .mobile.touchOverflowEnabled = true;}); & Lt; / Script & gt;   

But still the same result any thoughts why ?? My list view:

  & lt; Div data-role = "page" id = "getAll_JSON" & gt; & Lt; Div data-role = "header" & gt; & Lt; H1 & gt; Information & lt; / H1> & Lt; / Div & gt; & Lt; Div data-role = "content" & gt; & Lt; Ul id = "sitesList" data-role = "list view" data-filter = "true" data-partition-icon = "gear" & gt; & Lt; / Ul & gt; & Lt; / Div & gt; & Lt; Div data-role = "footer" & gt; & Lt; / Div & gt;   

My jquery ajax:

  $ .ajax ({url: mysite + "func = getM", data: Failure on the attachment ('error');} lat = '+ latitude + "and long =" + long, data type: "Jason", cache: wrong, error: function () {$ (' # coupon '). : Function) {$ ('# coupon'). Attached ('Failure');}, Status Code: {404: Function () {Alert ("No Information");}}, Success: Work (Results) {$ .each (('& lt; li onclick = "GetSite ('+ dat.coupon_id +')" & gt; '+' & lt; a href = "flx" #detailsPage ">" + '& lt; img src = "image /' + dat.coupon_img & Lt; p style = "white space: generic; margin-right: 2am;" & gt; name: & lt; strong & amp; nbsp; & quot; style = "float: left" width = 80 / Gt; '+ dat.coupon_name +' & lt; / strong & gt; & lt; / p & gt; '+' & lt; p style = "white-space: normal; margin-right:" + Dat.street + '& Lt; / p & gt;' + '& lt; p style = "white-space: general; margin-right : 2em; "& gt; Add: '+ dat.coupon_tmp +' & lt; / p & gt; '+'  
& gt; ';)}); $ ('# Sites List'). Listview ('Refresh');}})

Remove onClick attribute from

  1. li . Insert it inside a tag.
  2. < P> Even better, use
      $ ("# sitesList"). "Click", "a", function (e) {});    
  3. You can archive the coupon ID which will be getSite () in the data - attribute Passing when you are adding data to li :

      '& lt; Li & gt; + '& Lt; A href = "# Details Page" Data-Confidential = "'+ Dat.id +'" & gt; + '& Lt; Img src = "picture / '+ dat.coupon_img +'" style = "float: left" width = 80 />; + '& Lt; P style = "white-space: generic; margin-right: 2 names;" & Gt; Name: & lt; Strong> + Dat.coupon_name + '& lt; / Strong & gt; & Lt; / P & gt; + '& Lt; P style = "white-space: general; margin-right: 2em;" & Gt; Info: '+ dat.street +' & lt; / P & gt; '+' & Lt; P style = "white-space: normal; margin-right: 2em;" & gt; Addition: '+ dat.coupon_tmp +' & lt; / P & gt; '+' & Lt; / A & gt; & Lt; / Li & gt; '   
  4. When you are tapping on a tag : preventdefault / Li>

  5. In the href what's with a you are not contradicting yourself? On li Your tapping will be clicked on a , which in turn will redirect detailsPage .

No comments:

Post a Comment