gpt4 book ai didi

javascript - Kendo Ui 与 Angular - 看不到网格

转载 作者:行者123 更新时间:2023-11-28 08:38:44 25 4
gpt4 key购买 nike

我正在尝试将 kendo ui 与 Angular 一起使用,我已经下载了 kendo.all.js 和 angular-kendo.js我创建了一个简单的 Controller

var testApp = angular.module('testApp', ['ngRoute', 'kendo.directives']);
testApp.controller('mainCtrl', function mainCtrl($scope) {
$scope.name='Hello';

$scope.products = new kendo.data.DataSource({
data: [
{ id: 1, name: 'Tennis Balls', department: 'Sports', lastShipment: '10/01/2013' },
{ id: 2, name: 'Basket Balls', department: 'Sports', lastShipment: '10/02/2013' },
{ id: 3, name: 'Oil', department: 'Auto', lastShipment: '10/01/2013' },
{ id: 4, name: 'Filters', department: 'Auto', lastShipment: '10/01/2013' },
{ id: 5, name: 'Dresser', department: 'Home Furnishings', lastShipment: '10/01/2013' }
]
});

});

并添加到 View

<div>
<div kendo-grid k-data-source="products" k-selectable="'row'"
k-pageable="{ 'refresh': true, 'pageSizes': true }"
k-columns="[
{ 'field': 'name, 'title': 'Name''},
{ 'field': 'department', 'title': ''Department'},
{ 'field': 'lastShipment', 'title': 'Last Shipment' }
]">
</div>
</div>

但是当我启动它时,我得到了没有错误的空白页面

最佳答案

我忘记添加 angular.module('testApp', ['ngRoute', 'kendo.directives']);

关于javascript - Kendo Ui 与 Angular - 看不到网格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20764142/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com