-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
43 lines (31 loc) · 1.17 KB
/
main.js
File metadata and controls
43 lines (31 loc) · 1.17 KB
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
agGrid.initialiseAgGridWithAngular1(angular);
var module = angular.module("example", ["agGrid"]);
module.controller("exampleCtrl", function($scope) {
var columnDefs = [
{headerName: "Your name", field: "name", width: 150},
{headerName: "Your place", field: "place", width: 150},
{headerName: "Your old", field: "old", width: 150}
];
var rowData = [
{name: "john", place: "Ankara", old: 35},
{name: "ferdinand", place: "Manisa", old: 32},
{name: "ceren", place: "Antalya", old: 27}
];
$scope.gridOptions = {
columnDefs: columnDefs,
rowData: rowData,
rowSelection: 'single',
enableColResize: true,
enableSorting: true,
enableFilter: true,
groupHeaders: true,
toolPanelSuppressPivotMode: true,
onModelUpdated: onModelUpdated
};
function onModelUpdated() {
var model = $scope.gridOptions.api.getModel();
var totalRows = $scope.gridOptions.rowData.length;
var processedRows = model.getRowCount();
$scope.rowCount = processedRows.toLocaleString() + ' / ' + totalRows.toLocaleString();
};
});