2015-04-23 72 views
0

我的劍道UI核心的ListView工作不因某種原因,我想不通爲什麼:劍道的ListView不工作

<div id="events-upcoming"></div> 

<script type="text/x-kendo-template" id="events-template"> 
    <div class="event"> 
     <p>#: Title #</p> 
    </div> 
</script> 

<script> 
    $(document).ready(function() {      

     var upcomingEvents = new kendo.data.DataSource({ 
      transport: { 
       read: { 
        url: "http://localhost/supersavings/services/eventservice.asmx/GetFutureEventsByCompanyName", 
        type: "post", 
        contentType: "application/json; charset=utf-8", 
        dataType: "json", 
        data: { 
         companyName: "admin", 
         currentDate: "1/1/2015" 
        } 
       }, 
       parameterMap: function (options) { 
        return kendo.stringify(options); // kendo.stringify serializes to JSON string 
       } 
      }, 
      schema: { 
       data: "d" 
      } 
     }); 

     $("#events-upcoming").kendoListView({ 
      datasource: upcomingEvents, 
      template: kendo.template($("#events-template").html()) 
     }); 
    }); 
</script> 

我的JSON數據如下:

{ 
    "d":[ 
     { 
     "__type":"SSEvent", 
     "EventID":7, 
     "Title":"Test Title", 
     "StartDateTime":"/Date(1426212900000)/", 
     "EndDateTime":"/Date(-62135578800000)/", 
     "Description":null, 
     "Link":null, 
     "UseCurrentLocation":false, 
     "UseProfileLink":false, 
     "UserID":0, 
     "VenueName":"", 
     "VenueAddress":null, 
     "VenueCity":null, 
     "VenueState":null, 
     "VenueZip":null, 
     "CompanyDisplayName":null, 
     "CompanyAddress":null, 
     "CompanyAddress2":null, 
     "CompanyCity":null, 
     "CompanyState":null, 
     "CompanyZip":null 
     } 
    ] 
} 

的數據源作品。我已經成功地將它綁定到模板。出於某種原因,ListView不想工作。

回答

0

這是一個愚蠢的錯誤。在ListView數據源中應該是DataSource。唯一的問題是小寫字母S.我希望有一個調試器或工具,可以捕捉像Visual Studio用C#那樣的錯誤框或錯誤拼寫錯誤。