Kaidul
Kaidul

Reputation: 15915

jQuery mobile List-View is not working after adding some jquery code

I am using jquery mobile and I have an array makeArray in jquery and I have created few listview by the values of the array.Everything works fine.But the jquery mobile styled list-view is not shown. Rather it is shown an ordinary list view with no style. This is my code:

$(document).ready(function(){
        var url = "inventory/inventory.json";
        var makeArray = new Array();
        $.getJSON(url, function(data){
            $.each(data, function(index, item){
                if(($.inArray(item.make, makeArray)) == -1){
                    makeArray.push(item.make);
                    $('.upper_case')
                    .append('<li data-icon="list-arrow"> <a href="trade_form.php?='+ item.make +'"><img src="images/car_logo/buick.png" class="ui-li-thumb"/>' + item.make + '</a></li>');
                }
            });
        });
      });

Upvotes: 1

Views: 118

Answers (1)

mram888
mram888

Reputation: 5139

You need to refresh the listview:

  $('upper_case').listview('refresh');

Upvotes: 4

Related Questions