[英]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.