|
10 | 10 | <link href="/dist/release/ui-grid.css" rel="stylesheet"> |
11 | 11 |
|
12 | 12 | <!--<script src="https://code.jquery.com/jquery-1.11.1.js"></script>--> |
13 | | - <script src="/lib/test/angular/1.2.21/angular.js"></script> |
| 13 | + <script src="/lib/test/angular/1.2.26/angular.js"></script> |
14 | 14 | <script src="/dist/release/ui-grid.js"></script> |
15 | 15 |
|
16 | 16 | <style> |
|
19 | 19 | min-height: 600px; |
20 | 20 | } |
21 | 21 | .grid { |
22 | | - height: 50%; |
23 | | - width: auto; |
| 22 | + width: 500px; |
| 23 | + height: 400px; |
24 | 24 | } |
25 | 25 | .placeholder { |
26 | 26 | height: 50%; |
|
35 | 35 |
|
36 | 36 | <!-- <div class="row main"> --> |
37 | 37 | <h2>Grid</h2> |
38 | | -<div ui-grid="gridOptions" class="grid" ui-grid-selection></div> |
| 38 | +<div ui-grid="gridOptions" class="grid" ui-grid-pinning ui-grid-resize-columns></div> |
39 | 39 | <!-- <div class="placeholder"> --> |
40 | 40 | <!-- </div> --> |
41 | 41 |
|
42 | 42 | <br> |
43 | 43 | <br> |
44 | 44 |
|
45 | 45 | <script> |
46 | | - var app = angular.module('test', ['ui.grid', 'ui.grid.selection']); |
| 46 | + var app = angular.module('test', ['ui.grid', 'ui.grid.pinning', 'ui.grid.resizeColumns']); |
47 | 47 | app.controller('Main', function($scope, $http) { |
48 | | - // $scope.gridOptions = { data: 'data' }; |
49 | | - $scope.gridOptions = { |
50 | | - enableFiltering: true |
51 | | - }; |
| 48 | + $scope.gridOptions = {}; |
52 | 49 | $scope.gridOptions.columnDefs = [ |
53 | | - { |
54 | | - name : "Name", |
55 | | - field: "name", |
56 | | - cellTemplate: '/misc/demo/cellTemplate.html' |
57 | | - } |
| 50 | + { name:'id', width:50 }, |
| 51 | + { name:'name', width:100, pinnedLeft:true }, |
| 52 | + { name:'age', width:100, pinnedRight:true }, |
| 53 | + { name:'address.street', width:150 }, |
| 54 | + { name:'address.city', width:150 }, |
| 55 | + { name:'address.state', width:50 }, |
| 56 | + { name:'address.zip', width:50 }, |
| 57 | + { name:'company', width:100 }, |
| 58 | + { name:'email', width:100 }, |
| 59 | + { name:'phone', width:200 }, |
| 60 | + { name:'about', width:300 }, |
| 61 | + { name:'friends[0].name', displayName:'1st friend', width:150 }, |
| 62 | + { name:'friends[1].name', displayName:'2nd friend', width:150 }, |
| 63 | + { name:'friends[2].name', displayName:'3rd friend', width:150 } |
58 | 64 | ]; |
59 | | - $http.get('/misc/site/data/100.json') |
60 | | - .success(function (data) { |
| 65 | + |
| 66 | + $http.get('https://rawgit.com/angular-ui/ui-grid.info/gh-pages/data/500_complex.json') |
| 67 | + .success(function(data) { |
61 | 68 | $scope.gridOptions.data = data; |
62 | 69 | }); |
63 | 70 | }); |
|
0 commit comments