2016-06-03 5 views
0

typescript를 사용하여 aurelia에서 Kendo Grid를 사용하려하지만 초기화하려고하면 오류가 계속 발생합니다.Aurelia Typescript에서 검도 그리드 만들기

/// <reference path="../../../../vendors/Kendoui/typescript/kendo.all.d.ts" /> 

export class Test 
{ 
    attached() 
    { 
     $("#grid").kendoGrid(); 
    } 
} 

내가지고있어 오류가 Unhandled rejection TypeError: $(...).kendoGrid is not a function

누군가가 내가 뭘 잘못 말해 주시겠습니까입니까 ??

편집 : Aurelia-Kendo-bridge를 사용하여 보았지만 성능상의 이유로 사용하지 않기로 결정했습니다.

감사

+0

제 3 자 라이브러리를 Aurelia에 통합하는 것에 관심이있을만한 블로그를 작성했습니다 : http://davismj.me/blog/aurelia-drag-and-drop –

답변

1

아우렐 리아 - kendoui 브리지 프로젝트를 살펴 보자 :

<template> 
    <ak-grid k-data-source.bind="datasource" 
      k-pageable.bind="{ refresh: true, pageSizes: true, buttonCount: 10 }" 
      k-sortable.bind="true"> 
    <!-- Column definitions in HTML --> 
    <ak-col k-title="Contact Name" k-field="ContactName"> 
     <ak-template> 
     <!-- Column templates directly in your markup - where they belong! --> 
     <div class="customer-photo" style="background-image: url(../content/web/Customers/${CustomerID}.jpg);"></div> 
     <!-- Use Aurelia binding features like interpolation, value converters and binding behaviors --> 
     <div class="customer-name">${ContactName}</div> 
     </ak-template> 
    </ak-col> 
    <ak-col k-title="Contact Title" k-field="ContactTitle"></ak-col> 
    <ak-col k-title="Company Name" k-field="CompanyName"></ak-col> 
    <ak-col k-field="Country"></ak-col> 
    </ak-grid> 
</template> 

그리고 뷰 모델 :

export class ViewModel { 
    datasource = { 
    type: 'odata', 
    transport: { 
     read: '//demos.telerik.com/kendo-ui/service/Northwind.svc/Customers' 
    }, 
    pageSize: 5 
    }; 
} 

https://github.com/aurelia-ui-toolkits/aurelia-kendoui-bridge 이 자신의 구성 요소 카탈로그의 예입니다 원래의 질문에 따라 검도를 가져 오지 않았을 수도 있습니다. 귀하의 뷰 모델 파일 상단에 가져 오기 문을 넣으십시오.

+0

제안에 감사드립니다. 마누엘, 나는 보았습니다. 이 작업은 이미 작동하고 있지만 성능 문제로 인해 지금은 사용하지 않을 것입니다. – Danny

1

검도를 가져 오는 방법은 무엇입니까? es2015를 사용하고 나중에 인덱스 페이지에서 js 파일을 수동으로 가져 오는 것으로 전환 된 systemJS bu. 크기를 줄이기 위해 위젯을 모두 가져올 수 없습니다. 내 방식으로 수행하는 Ofcourse는 kendo 라이브러리가 필요한 첫 번째 시점의 istead를로드한다는 것을 의미 할 수 있습니다.