|
| 1 | +<!DOCTYPE html> |
| 2 | +<html class="no-js" ng-app="test"><!--<![endif]--> |
| 3 | +<head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"> |
| 6 | + <title></title> |
| 7 | + <meta content="width=device-width" name="viewport"> |
| 8 | + |
| 9 | + <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css" /> |
| 10 | + <link href="/dist/release/ui-grid.css" rel="stylesheet"> |
| 11 | + |
| 12 | + <!--<script src="https://code.jquery.com/jquery-1.11.1.js"></script>--> |
| 13 | + <script src="/lib/test/angular/1.3.16/angular.js"></script> |
| 14 | + <script src="https://code.angularjs.org/1.3.16/angular-aria.js"></script> |
| 15 | + <script src="/dist/release/ui-grid.js"></script> |
| 16 | + |
| 17 | + <style> |
| 18 | + body { |
| 19 | + padding: 60px; |
| 20 | + min-height: 600px; |
| 21 | + } |
| 22 | + .grid { |
| 23 | + width: 1200px; |
| 24 | + height: 400px; |
| 25 | + } |
| 26 | + .placeholder { |
| 27 | + height: 50%; |
| 28 | + width: 50%; |
| 29 | + border: 3px solid black; |
| 30 | + background: #ccc; |
| 31 | + } |
| 32 | + </style> |
| 33 | +</head> |
| 34 | +<body ng-controller="Main"> |
| 35 | +<!-- <h1>Test</h1> --> |
| 36 | + |
| 37 | +<!-- <div class="row main"> --> |
| 38 | +<h2>Grid</h2> |
| 39 | +<div ui-grid="gridOptions" class="grid" ui-grid-resize-columns ui-grid-cellNav ui-grid-pagination></div> |
| 40 | +<!-- <div class="placeholder"> --> |
| 41 | +<!-- </div> --> |
| 42 | + |
| 43 | +<br> |
| 44 | +<br> |
| 45 | + |
| 46 | +<script> |
| 47 | + var app = angular.module('test', ['ui.grid', 'ui.grid.pinning', 'ui.grid.resizeColumns', 'ui.grid.cellNav', 'ui.grid.pagination', 'ngAria']); |
| 48 | + app.controller('Main', function($scope, $http) { |
| 49 | + $scope.gridOptions = { |
| 50 | + enableSorting: true, |
| 51 | + showGridFooter: true, |
| 52 | + enableGridMenu: true, |
| 53 | + enableFiltering: true, |
| 54 | + paginationPageSizes: [25, 50, 75, 100], |
| 55 | + paginationPageSize: 25, |
| 56 | + useExternalPagination: false, |
| 57 | + useExternalSorting: false, |
| 58 | + }; |
| 59 | + $scope.gridOptions.columnDefs = [ |
| 60 | + { name:'id', width:50 }, |
| 61 | + { name:'name', width:100, pinnedLeft:true }, |
| 62 | + { name:'age', width:100, pinnedRight:true }, |
| 63 | + { name:'address.street', width:150 }, |
| 64 | + { name:'address.city', width:150 }, |
| 65 | + { name:'address.state', width:50 }, |
| 66 | + { name:'address.zip', width:50 }, |
| 67 | + { name:'company', width:100 }, |
| 68 | + { name:'email', width:100 }, |
| 69 | + { name:'phone', width:200 }, |
| 70 | + { name:'about', width:300 }, |
| 71 | + { name:'friends[0].name', displayName:'1st friend', width:150 }, |
| 72 | + { name:'friends[1].name', displayName:'2nd friend', width:150 }, |
| 73 | + { name:'friends[2].name', displayName:'3rd friend', width:150 } |
| 74 | + ]; |
| 75 | + |
| 76 | + $http.get('https://rawgit.com/angular-ui/ui-grid.info/gh-pages/data/500_complex.json') |
| 77 | + .success(function(data) { |
| 78 | + $scope.gridOptions.data = data; |
| 79 | + }); |
| 80 | + }); |
| 81 | +</script> |
| 82 | +</body> |
| 83 | +</html> |
0 commit comments