在laravel项目的公共文件夹中存储ag-grid文件夹。这是default.blade.php的内容,其中存储了css和js脚本的所有链接。
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script>
<script scr="http://demos.angularcode.com/grid/js/ui-bootstrap-tpls-0.10.0.min.js"></script>
<script src="https://cdn.rawgit.com/esvit/ng-table/1.0.0/dist/ng-table.js"></script>
<link rel="stylesheet" href="/js/ag-grid/dist/angular-grid.css" />
<link rel="stylesheet" href="/js/ag-grid/dist/theme-blue.css" />
<script src="/js/ag-grid/dist/angular-grid.js"></script>
<script src="{{ URL::asset('js/dashboard/novi.controller.js') }}"></script>
这是我的控制器
var kongres = angular.module('kongres', ["angularGrid"]);
kongres.controller('NoviController', NoviController);
function NoviController($scope, $http, $timeout) {
$scope.title = 'nsdlob';
var columnDefs = [
{headerName: "Broj fakture", field: "broj_zavodjenja", width: 110, sort: 'desc'},
{
headerName: "Datum zavodjenja",
field: "rm_izlaz_master_datum_zavodjenja",
width: 130,
cellClass: 'grid-align'
},
{headerName: "Datum valute", field: "rm_izlaz_master_datum_valute", width: 130, cellClass: 'grid-align'},
{headerName: "Vrsta dokmenta", field: "naziv", width: 240},
{headerName: "Partner", field: "partneri_naziv", width: 300},
{headerName: "Napomena", field: "napomena", width: 300},
{headerName: "Broj artikala", field: "brart", width: 105, cellClass: 'grid-align'},
{headerName: "Ukupno", field: "ukupno", width: 150, cellClass: 'grid-align-right'}
];
$scope.gridOptions = {
columnDefs: columnDefs,
enableColResize: true,
groupHeaders: true,
rowHeight: 32,
showToolPanel: true,
rowGroupPanelShow: 'always',
enableStatusBar: true,
enableSorting: true,
rowSelection: 'single',
onRowClicked: function (event) {
$state.go('faktura-detail', {id: event.data.id});
},
enableFilter: true
};
}
这是我应该显示网格的页面
@extends(isset($layout)?$layout:'layout.default')
@section('content')
<div class="page-content-wrapper" ng-controller="NoviController">
<!-- BEGIN CONTENT BODY -->
<div class="page-content">
<div class="row">
<div class="col-lg-12 portlet light bordered">
<div class="portlet-title">
<div class="caption font-dark">
<i class="icon-people"></i>
<span class="caption-subject bold uppercase">Hotel bookings</span>
</div>
</div>
<div class="portlet-body">
@{{ title }}
<div ag-grid="gridOptions" style="height: 600px;" class="ag-blue"></div>
</div>
</div>
</div>
<!-- /.row -->
</div>
</div>
<!-- /.container-fluid -->
@stop 但是当我打开这个页面时,网格显示没有任何可能的组,拖动顺序等。它看起来像ap-grid.js不包括在内。