1

Using jqmobi 1.2
I'm trying to update the content of a panel with the result of an ajax call. Following panel will collect the string to search for.

<div id="register_form" class="panel" data-defer="" data-header="default" data-footer="register_footer" data-load="" data-unload="">
<form id="register_data" class="selected">
   <fieldset class="scrollable" data-pull-scroller="true">
      <legend class="toggelable" >Organization:</legend>
         <div id=""class="toggelable">
            <label for="seleced_org"  >Bezeichnung:</label><br>  
               <input type="text" id="seleced_org" class="toggelable jq-ui-forms" ><br>
                  <a class="button icon magnifier" href="javascript:searchOrg();">Search</a>
          </div>
       </fieldset>
</form>
</div>

The button will call following function, where the success method will add elements to the panel with the id "org_options".

Ajax function:

var FOUNDORGS = [];

function searchOrg() {
   var request = $('input[id=seleced_org]').val();
   $.ajax({
       url: mcTime.ASURL + "/OrgCheck",
       dataType: "JSONP",
       crossDomain: true,
       data: {
           maxRows: 12,
           name_startsWith: request,
           callback: ''
       },
       success: function(data) {
          /*
           * server response: [{"organisationId":1,"workerquantity":0,"name":"My_Org","street":"Org_Street 1","zipcode":"45454","city":"Org_City"}]
           */
           FOUNDORGS = $.parseJSON(data);    

           if ($('fieldset[name="options"]').find('.matchingOrgs').length == 0) {
               $('fieldset[name="options"]').append('<ul class="mc matchingOrgs"></ul>');
           }
           var toAppend = $('fieldset[name="options"]').find('.matchingOrgs')[0];
           $(toAppend).html('');
           for (var i = 0; i < FOUNDORGS.length; i++) {
               var obj = FOUNDORGS[i];
               var li = $('<li>\n\
                    <a class="orglink" href="javascript:showOrgDetail(\'' + obj.organisationId + '\',\'' + obj.name + '\');">' + obj.name + '</a>\n\
                    </li>');
               $(toAppend).append(li);
           }

           $.ui.loadContent('#org_options', false, false, 'slide');
       }
   });
 }

appended div:

<div id="org_options" class="panel" data-header="default" data-footer="register_footer" modal="false" data-unload="">
   <fieldset name="options" class="mc scrollable" data-pull-scroller="true">
      <legend >Results:</legend>
   </fieldset>
 </div>

All this works fin in my browser (chrome), and with the XDK emulator but not on my iPhone when using the XDK app-tester.

Any body any idea??

1 Answer 1

0

I'm the lead dev on App Framework. There's a bug in the iOS container with handling JSON data from remote servers. There are some posts over at http://forums.html5m.com about it. It's logged internally in our bug tracking system.

thanks, Ian

1
  • I dont thinkt that this is the cause. Because when i change the fieldset tag with a simple <p> and and just insert the returned message ("data" in the method) as text, the panel will show the <p> accordingly May 1, 2013 at 8:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.