2013-02-05 4 views
0

아래의 검도 그리드에서 렌더링 할 로컬 데이터 (var people)를 얻지 못하는 것 같습니다. people 배열 및 dataSource 특성이 없으면 열 데이터가 잘 렌더링됩니다. 오류가 어디에 있는지 확실하지 않습니다. 내가 보는 몇 가지가있다검도 UI 그리드가 로컬 데이터를 가져 오지 않음

<!doctype html> 
<head> 
<link href="styles/kendo.common.min.css" rel="stylesheet" type="text/css" /> 
<link href="styles/kendo.default.min.css" rel="stylesheet" type="text/css" /> 
<script src="js/jquery.min.js" type="text/javascript"></script> 
<script src="js/kendo.web.min.js" type="text/javascript"></script> 

</head> 
<body> 
<div id="grid"> 
</div> 
<script> 
$(function(){ 
    $("#grid").kendoGrid({ 

     var people = [{patientName: "John Doe", MRN: "464684778", account: "56765765224768", dateOfBirth: "01/06/2013", room: 403, bed: 22, admitDate: "01/15/2013" }]; 

       columns: [{title: "Patient Name"}, 
        {title: "MRN"}, 
        {title: "Account#"}, 
        {title: "Date of Birth"}, 
        {title: "Room"}, 
        {title: "Bed"}, 
        {title: "Admit Date"}], 

        dataSource: { 
      data:people 
     }     
    }); 
}); 
</script> 
</body> 
</html> 

답변

2

...

  1. 사람들의 배열은 당신이 당신의 열이 필드를 지정하지 않은 그리드 초기화 코드
  2. 안에 있습니다.

    $(function(){ 
    
        var people = [{patientName: "John Doe", MRN: "464684778", account: "56765765224768", dateOfBirth: "01/06/2013", room: 403, bed: 22, admitDate: "01/15/2013" }]; 
    
    
        $("#grid").kendoGrid({ 
        columns: [{field: "patientName", title: "Patient Name"}, 
           {field: "MRN", title: "MRN"}, 
           {field: "account", title: "Account#"}, 
           {field: "dateOfBirth", title: "Date of Birth"}, 
           {field: "room", title: "Room"}, 
           {field: "bed", title: "Bed"}, 
           {field: "admitDate", title: "Admit Date" }], 
        dataSource: { 
         data:people 
        }     
        }); 
    
    }); 
    

근무 샘플 : http://jsbin.com/uxaqus/1

+0

정말 고마워요 버크! 이런, 필드 데이터를 매핑하는 것이 도움이되었습니다 .-) – user763460

관련 문제