1

这是我的 .html 文件:-

<div data-role="page" id="home">
        <div data-role="content">
            <ul id="productList" data-role="listview" data-inset="true">               
            </ul>
    </div>
</div>

这是我的 .js 代码:-

var respPrice = {"Value":[{"ID":"1","productID":"10","subsID":"9","MinPrice":"500","MaxPrice":"50000","Subs":"xyz1"},
                         {"ID":"2","productID":"10","subsID":"9","MinPrice":"9020","MaxPrice":"90020","Subs":"xyz12345"}]}

$.each(respPrice.Value, function(index, value) {
      if(respPrice.length == 0) {
         alert('No product subs list found');
      } else {

       subsId = value.subsID;
       substance = value.Subs;
       minPrice = value.MinPrice;
       maxPrice = value.MaxPrice;        
      $respPrice = '<li class="ui-btn ui-btn-icon-right ui-li-has-arrow ui-li ui-last-child ui-btn-up-e">' + substance + minPrice + '-' + maxPrice + '</li>';

       $('#productList').append($respPrice);
     }               
 });

 $('#productList').listview('refresh');

结果如下:-

在此处输入图像描述

无法提供“Subs”和“MinPrice-MaxPrice”之间的适当距离。任何帮助将不胜感激。

4

0 回答 0