Created
June 1, 2014 21:29
-
-
Save josebalius/32b35f66759ad068f357 to your computer and use it in GitHub Desktop.
ngReactGrid - Server side
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html ng-app="example"> | |
<head> | |
<title>ngReactGrid Basic Example</title> | |
<link rel="stylesheet" type="text/css" href="css/ngReactGrid.css"> | |
</head> | |
<body> | |
<div ng-controller="BasicExampleController" style="width: 100%"> | |
<ng-react-grid grid="grid"></ng-react-grid> | |
</div> | |
<!-- Your JS Sources --> | |
<script src="js/angular.min.js" type="text/javascript" ></script> | |
<script src="js/react-0.10.0.js" type="text/javascript" ></script> | |
<script src="js/ngReactGrid.min.js" type="text/javascript" ></script> | |
<script src="./dataSet.js"></script> | |
<script type="text/javascript"> | |
angular.module("example", ['ngReactGrid']) | |
.controller("BasicExampleController", function($scope, $timeout) { | |
$scope.grid = { | |
data: [], | |
columnDefs: [ | |
{ | |
field: "firstName", | |
displayName: "First Name" | |
}, | |
{ | |
field: "lastName", | |
displayName: "Last Name" | |
}], | |
localMode: false, | |
getData: function() { | |
var grid = this; | |
$timeout(function() { | |
$scope.grid.data = dataSet.slice((grid.currentPage - 1) * grid.pageSize, (grid.pageSize * grid.currentPage)); | |
$scope.grid.totalCount = dataSet.length; | |
}, 2000); | |
} | |
}; | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment