[英]AngularJS ng-grid clumping together grid
我正在尝试做一个基本的ng-grid
。 我已经定义了并且它有数据。 我也会附上一张图片,我从未见过ng-grid这样做,但这是我第一次自己进行设置,所以也许我做错了。 这是我的代码:
我的控制器:
controllers.controller('searchResultsController', ['$scope', '$rootScope',
function($scope, $rootScope) {
$scope.data = $scope.searchResults.data || $rootScope.searchResults.data;
$scope.resultsGridOptions = {
data: 'data',
columnDefs: [
{
field: 'startingCity',
displayName: 'Starting City',
width: '***'
},
{
field: 'destination',
displayName: 'Destination',
width: '***'
},
{
field: 'airline',
displayName: 'Airline',
width: '**'
},
{
field: 'price',
displayName: 'Price',
width: '*'
},
{
field: 'seatsInFirstClass',
displayName: 'Seats In First Class',
width: '*'
},
{
field: 'seatsInEconomy',
displayName: 'Seats In Economy',
width: '*'
}
]
};
}
]
);
我的应用程式声明:
angular.module('reservationsApp', ['ngRoute', 'ngGrid', 'ui.bootstrap', 'reservationsControllers']);
如果可以,我的模板(虽然很简单):
<div class="gridStyle" ng-grid="resultsGridOptions"></div>
我想通了,@ GregL弄清楚了。 我没有正确导入ng-grid.css
文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.