2013-08-23 2 views
2

나는 Jquery와 함께 Kendo Grdi를 사용하고 있습니다. 그 표에는 DateTime 열이 있습니다. 해당 열의 데이터는 "/ Date (1377196200000) /"와 같이 표시됩니다. 이것을 적절한 형식으로 배열하도록 도와주세요.Kendo Ui Grid 날짜 시간 Convertion 문제

이것은 내 그리드의 스크립트입니다.

기능 LoadGridView() {

var dataSource = GetDataSource(); 

$("#batchgrid").kendoGrid({ 
    dataSource: dataSource, 
    editable: "inline", 
    selectable: "row", 
    toolbar: ["create"], 
    autobind: true, 
    reorderable: true, 
    pageable: { 
     refresh: true, 
     pageSizes: [5, 10, 20, 50, 100] 
    }, 
    sortable: { 
     mode: "multiple" 
    }, 
    sort: { field: "PrjNm", dir: "asc" }, 
    groupable: { 
     messages: { 
      empty: "Drop columns here" 
     } 
    }, 
    columnMenu: { 
     sortable: true, 
     filterable: true, 
     messages: { 
      columns: "Hide/Show Columns", 
      filter: "Apply filter", 
      sortAscending: "Sort (asc)", 
      sortDescending: "Sort (desc)" 
     } 
    }, 
    resizable: true, 
    dataBinding: function() { 
     record = (this.dataSource.page() - 1) * this.dataSource.pageSize(); 
    }, 
    filterable: { 
     messages: { 
      and: "And", 
      or: "Or", 
      filter: "Apply filter", 
      clear: "Clear filter", 
      info: "Filter by" 
     }, 
     extra: false, //do not show extra filters 
     operators: { // redefine the string operators 
      string: { 
       contains: "Contains", 
       doesnotcontain: "Doesn't contain", 
       startswith: "Starts With", 
       endswith: "Ends" 
      }, 
      number: { 
       eq: "Is Equal To", 
       neq: "Not equal to", 
       gte: "Greater than or equal to", 
       lte: "Less than or equal to", 
       gt: "Greater than", 
       lt: "Less than" 
      } 
     } 
    }, 
    navigatable: true, 
    columns: [ 
        { title: "No", template: "#= ++record #", width: 45 }, 
        { field: "ItemCode", title: "Item Code", width: "150px" }, 
        { field: "ItemName", title: "Item Name", format: "{0:c}", width: "300px" }, 
        { field: "PreviousDate", title: "Previous Date", type: "date", format: "{0:dd/MM/yyyy}" }, 
        { field: "PreviousValue", title: "Previous %", width: "110px", format: "{0:2}" }, 
        { field: "Value", t`enter code here`itle: "%", width: "150px", format: "{0:2}" }, 
    { command: ["edit"], title: " ", width: "175px" } 
    ] 
}); 

}

답변

2

여기에 표시됩니다로 데이터 소스 모델에 (날짜로) 제대로 날짜 필드 유형을 정의해야합니다 :

model: { 
    fields: { 
     PreviousDate: { type: "date" }, 
      } 
     }