Even after lot of research am not able to find one good example which can help me run the angular UI-GRID example locally.
Here is the HTML file which am using, A simple file called 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>
Here is the app.js which you can place in the same path as that of html.
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];
}]);
The ui-grid-unstable.js and ui-grid-unstable.css is downloaded from the link :
http://ui-grid.info/release/ui-grid-unstable.js and http://ui-grid.info/release/ui-grid-unstable.css
Please please do help me as am just spending time to run this.
I was able to run the ng-grid for my requirement but since there was no column and row adjustment feature i have to switch to ui-grid now.