forked from angular-ui/ui-grid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes to column menus, headerCellFilter and fixing two grids
This branch combines the current upstream/master with pull requests in upstream that made merging angular-ui#1501 in particular difficult. Key changes are: 1. Add hide column to column menu Also includes "google translation" standard translations. Noted that error is occurring intermittently in testing: ui-grid watch for new pinned containers fires watch for right container FAILED Tested and validated that this is also occurring on upstream/master, so presume not to do with changes I've made. 2. Fix column menu with two grids: move from self to scope Moved most of column-menu methods and variables onto $scope so that context didn't get misaligned, and therefore two grids is possible. Added tutorial page showing two grids. 3. HeaderCellTemplate from column builder used, filter permitted on headerCell Modify defaultColumnBuilder to add a headerCellFilter property to columnDef, allowing a translate to be applied to the header without needing to use a custom header template. This translate in my case is angular-translate, used for internationalisation. Modify ui-grid-header-cell directive to use the header template from the column builder, rather than ignoring it, which would address a concern raised by @Shazypro on gitter. Minor modifications to templates because the result of a compiled template seems a little different than an inline template, and therefore some classes ended up in different places within the ng-repeat. This could alternatively be fixed in the css, but css is really not my thing. Noted that on my mac in chrome the column menus are not correctly attaching to the columns, but I believe this is a pre-existing problem not caused by this change.
- Loading branch information
Showing
21 changed files
with
405 additions
and
171 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
@ngdoc overview | ||
@name Tutorial: 211 Two grids on a page | ||
@description | ||
|
||
This grid example puts two grids on the same page, and demonstrates that they are isolated from | ||
each other. | ||
|
||
@example | ||
<example module="app"> | ||
<file name="app.js"> | ||
var app = angular.module('app', ['ui.grid', 'ui.grid.selection']); | ||
|
||
app.controller('MainCtrl', ['$scope', '$http', '$log', function ($scope, $http, $log) { | ||
$scope.gridOptions = {}; | ||
|
||
$http.get('/data/100.json') | ||
.success(function(data) { | ||
$scope.gridOptions.data = data; | ||
}); | ||
|
||
}]); | ||
|
||
app.controller('SecondCtrl', ['$scope', '$http', '$log', function ($scope, $http, $log) { | ||
$scope.gridOptions = {}; | ||
|
||
$http.get('/data/100.json') | ||
.success(function(data) { | ||
$scope.gridOptions.data = data; | ||
}); | ||
|
||
}]); | ||
</file> | ||
<file name="index.html"> | ||
<div ng-controller="MainCtrl"> | ||
<div id="firstGrid" ui-grid="gridOptions" ui-grid-selection class="grid"></div> | ||
</div> | ||
<div ng-controller="SecondCtrl"> | ||
<div id="secondGrid" ui-grid="gridOptions" ui-grid-selection class="grid"></div> | ||
</div> | ||
</file> | ||
<file name="main.css"> | ||
.grid { | ||
width: 500px; | ||
height: 300px; | ||
} | ||
</file> | ||
</example> |
This file contains 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
Oops, something went wrong.