Skip to content

Commit c7e3427

Browse files
Zhuk, AlexanderZhuk, Alexander
authored andcommitted
removing items-per-page directive + minor bootstrap update
1 parent aa74c75 commit c7e3427

File tree

5 files changed

+7
-68
lines changed

5 files changed

+7
-68
lines changed

README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
Light and flexible Data Grid for AngularJS apps, with built-in sorting, pagination and filtering options, unified API for client-side and server-side data fetching,
33
seamless synchronization with browser address bar and total freedom in mark-up and styling suitable for your application.
44

5-
Demo Material Design: http://angular-data-grid.github.io/demo/material.html
6-
75
Demo Bootstrap: http://angular-data-grid.github.io/
6+
Demo Material: http://angular-data-grid.github.io/demo/material.html
87

98
### Features
109
- Does not have any hard-coded template so you can choose any mark-up you need, from basic `<table>` layout to any `<div>` structure.
@@ -15,13 +14,9 @@ Demo Bootstrap: http://angular-data-grid.github.io/
1514

1615
### Installation
1716

18-
Using Bower:
19-
20-
```
21-
bower install angular-data-grid
22-
```
17+
Using Bower: `bower install angular-data-grid`
2318

24-
Using direct download: get ZIP archive [from here](https://github.com/angular-data-grid/angular-data-grid.github.io/archive/master.zip)
19+
Direct download: get ZIP archive [from here](https://github.com/angular-data-grid/angular-data-grid.github.io/archive/master.zip)
2520

2621
Then use files from *dist* folder (see below).
2722

@@ -100,8 +95,7 @@ angular.module('myApp', ['dataGrid', 'pagination'])
10095
2. `grid-actions`: object in your controller with functions for updating grid. You can pass string or create empty object in controller.
10196
Use this object for calling methods of directive: `sort()`, `filter()`, `refresh()`.
10297
3. Inside `grid-data` directive you can use `pagination` directive.
103-
4. Also you can use `grid-item-per-page` directive and pass into it array of values (e.g. 10, 25, 50).
104-
5. If you need get size of current displayed items you can use `{{filtered.length}}` value.
98+
4. If you need get size of current displayed items you can use `{{filtered.length}}` value.
10599

106100
### Fetch Data
107101
- For client-side pagination/filtering to fetch all data at once: just assign `gridOptions.data` to any JSON array object.

dist/dataGrid.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,12 @@
3838
$scope.$watch('_gridOptions.data', function (newValue) {
3939
if (newValue && newValue.length) {
4040
$scope.filtered = angular.copy($scope._gridOptions.data);
41-
4241
$scope.filters.forEach(function (filter) {
4342
if (filter.filterType === 'select') {
44-
//console.dir(filter);
4543
$scope[filter.model + 'Options'] = generateOptions($scope.filtered, filter.filterBy);
4644
}
4745
});
4846

49-
5047
if ($scope.urlSync) {
5148
parseUrl($location.path());
5249
} else {
@@ -330,32 +327,6 @@
330327
}
331328
}
332329
}])
333-
.directive('gridItemPerPage', ['$compile', function ($compile) {
334-
return {
335-
replace: true,
336-
template: '<ul class="pagination"></ul>',
337-
link: function (scope, element, attrs) {
338-
if (attrs.gridItemPerPage) {
339-
var values = attrs.gridItemPerPage.replace(/ /g, '').split(',');
340-
values.forEach(function (value) {
341-
if (Number(value)) {
342-
value = Number(value);
343-
} else {
344-
return;
345-
}
346-
var li = angular.element('<li></li>');
347-
var button = angular.element('<a href>' + value + '</a>');
348-
button.attr('ng-click', 'paginationOptions.itemsPerPage = ' + value + '; reloadGrid()');
349-
li.attr('ng-class', '{"active" : paginationOptions.itemsPerPage == ' + value + '}');
350-
li.append(button);
351-
element.append(li);
352-
element.append(' ');
353-
$compile(li)(scope);
354-
});
355-
}
356-
}
357-
}
358-
}])
359330
.factory('filtersFactory', function () {
360331
function selectFilter(items, value, predicate) {
361332
return items.filter(function (item) {

dist/dataGrid.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
<ul class="nav navbar-nav navbar-right">
1616
<li class="dropdown">
1717
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
18-
aria-expanded="false">Change Theme <span class="caret"></span></a>
18+
aria-expanded="false ">Change Theme <span class="caret"></span></a>
1919
<ul class="dropdown-menu dropdown-menu-right">
2020
<li>
21-
<a href="index.html">Bootstrap Design</a>
21+
<a href="index.html"><strong>Bootstrap Design</strong></a>
2222
</li>
2323
<li>
2424
<a href="demo/material.html">Material Design</a>

0 commit comments

Comments
 (0)