Friday, 15 May 2015

javascript - AngularJS ng-grid clumping together grid -



javascript - AngularJS ng-grid clumping together grid -

i'm trying basic ng-grid. have defined , has data. i'll attach image too, haven't ever seen ng-grid this, first time i'm setting myself maybe i'm doing wrong. here's code:

my controller:

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: '*' } ] }; } ] );

my app declaration:

angular.module('reservationsapp', ['ngroute', 'nggrid', 'ui.bootstrap', 'reservationscontrollers']);

and if it'll good, template (pretty plain though):

<div class="gridstyle" ng-grid="resultsgridoptions"></div>

here's screenshot of i'm getting

i figured out, well, @gregl figured out. wasn't importing ng-grid.css file correctly.

javascript angularjs ng-grid

No comments:

Post a Comment