-
Notifications
You must be signed in to change notification settings - Fork 2.5k
/
grid-directive.html
72 lines (60 loc) · 1.84 KB
/
grid-directive.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html class="no-js" ng-app="test"><!--<![endif]-->
<head>
<meta charset="utf-8">
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<title></title>
<meta content="width=device-width" name="viewport">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css" />
<link href="/dist/release/ui-grid.css" rel="stylesheet">
<!--<script src="https://code.jquery.com/jquery-1.11.1.js"></script>-->
<script src="/lib/test/angular/1.2.21/angular.js"></script>
<script src="/dist/release/ui-grid.js"></script>
<style>
body {
padding: 60px;
min-height: 600px;
}
.grid {
height: 50%;
width: auto;
}
.placeholder {
height: 50%;
width: 50%;
border: 3px solid black;
background: #ccc;
}
</style>
</head>
<body ng-controller="Main">
<!-- <h1>Test</h1> -->
<!-- <div class="row main"> -->
<h2>Grid</h2>
<div ui-grid="gridOptions" class="grid" ui-grid-selection></div>
<!-- <div class="placeholder"> -->
<!-- </div> -->
<br>
<br>
<script>
var app = angular.module('test', ['ui.grid', 'ui.grid.selection', 'ui.grid.expandable']);
app.controller('Main', function($scope, $http) {
// $scope.gridOptions = { data: 'data' };
$scope.gridOptions = {
enableFiltering: true
};
$scope.gridOptions.columnDefs = [
{
name : "Name",
field: "name",
cellTemplate: '/misc/demo/cellTemplate.html'
}
];
$http.get('/misc/site/data/100.json')
.success(function (data) {
$scope.gridOptions.data = data;
});
});
</script>
</body>
</html>