2015-04-23 74 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#那样的错误框或错误拼写错误。