Virtual list loaded from ajax data on pageInit not working on iOS device

Hi there,

I have a virtual list that is getting all the data from an api via a get request and it works well and surprisingly fast on the browser considering it is fetching upwards of a 1000 records. However, when testing on my iOS device, it doesn’t seem to work, it just keeps loading. I left it to run for 10 minutes but still had no luck. My code is below:

export default {
data: function() {
return{
items:[]
}
},
on: {
pageBeforeRemove: function () {
var self = this;
self.virtualList.destroy();
},
pageInit: function() {
var self = this;
var app = self.$app;
self.virtualList = app.virtualList.create({
el: self.$el.find(’.virtual-list’),
items: self.items,
searchAll: function (query, items) {
var found = [];
for (var i = 0; i < items.length; i++) {
if (items[i].Name.toLowerCase().indexOf(query.toLowerCase()) >= 0 || query.trim() === ‘’) found.push(i);
}
return found; //return array with mathced indexes
},
itemTemplate:

  • \n’ +
    ’ \n’ +
    ’ \n’ +
    \n’ +
    \n’ +
    {{Name}}
    \n’ +
    {{address}}
    ’+
    \n’ +
    ’ \n’ +
  • ',
    // Item height
    height: app.theme === ‘ios’ ? 63 : (app.theme === ‘md’ ? 73 : 46),
    });
        var filter = self.filter;
        app.preloader.show();
        app.request({
          url:'api url'',
          method:'GET',
          async:false,
          dataType:'json',
          success: function(data, textStatus ){
            self.virtualList.replaceAllItems(data.result.records);
            app.preloader.hide();
          },
        });
    
      }
    }
    

    };

    I have added an error function to the ajax request and the response I am getting is native xhr: invalid url scheme ‘(null)’; only http and https are supported.
    Its not a usual url but nonetheless it is https and it works.
    https://{can not provide}/datastore_search_sql?sql=SELECT"ABN",“Charity_Legal_Name”,“Address_Line_1”,“Town_City”,“State”,“Postcode”,“Country"FROM”{can not provide}“WHERE”’+filter+’"=‘Y’’

    I believe it is due to the sql operation being in the url which webview can not parse correctly, I have ended up just using the regular json api with post fields instead and all is working well.