即使很多研究都无法找到一个可以帮助我在本地运行角度UI-GRID示例的好例子。在页面上不显示网格的角度UI-GRID
下面是HTML文件,该文件正在使用,简单的文件名为index.html:
<!doctype html>
<html ng-app="app">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular-touch.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular-animate.js"></script>
<script src="release/ui-bootstrap-tpls-0.12.1.min"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css"/>
<link rel="stylesheet" href="release/ui-grid-unstable.css"/>
<link rel="stylesheet" href="main.css"/>
<script src="release/ui-grid-unstable.js"></script>
<script src="app.js"></script>
</head>
<body>
<div ng-controller="MainCtrl">
<div id="grid1" ui-grid="{ data: myData }" class="grid"></div>
</div>
</body>
</html>
这里是你可以在为HTML相同的路径放置app.js。
var app = angular.module('app', ['ngTouch', 'ui.grid']);
app.controller('MainCtrl', ['$scope', function ($scope) {
$scope.myData = [
{
"firstName": "Cox",
"lastName": "Carney",
"company": "Enormo",
"employed": true
},
{
"firstName": "Lorraine",
"lastName": "Wise",
"company": "Comveyer",
"employed": false
},
{
"firstName": "Nancy",
"lastName": "Waters",
"company": "Fuelton",
"employed": false
}]
,columnDefs: [field: 'firstName', displayName: 'First Name', width: '30%', maxWidth: 200, minWidth: 70],
[field: 'lastName', displayName: 'Last Name', width: '30%', maxWidth: 200, minWidth: 70];
}]);
的UI并网unstable.js和UI并网unstable.css从链接下载:
http://ui-grid.info/release/ui-grid-unstable.js 和 http://ui-grid.info/release/ui-grid-unstable.css
请请你帮我我只是花时间来运行这个。
我能够为我的需求运行ng-grid,但由于没有列和行调整功能,我不得不现在切换到ui-grid。
其实我看着一切,按照规定我能够在NG-GRID我的代码运行,但我想要的是做在ui-grid中,它仍然不稳定但正在工作。 – 2015-04-06 10:00:01
看到这个http://plnkr.co/edit/Tr9cNm0lDy62dmF7LNlr?p=preview是否有帮助 – Reena 2015-04-06 10:17:18
非常感谢Reena。这有助于:) – 2015-04-09 01:56:14