Skip to content

feat(Custom Scrolling): Adds the ability to overwrite default grid scrolling #5841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions misc/tutorial/407_custom_scrolling.ngdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
@ngdoc overview
@name Tutorial: 407 Custom Scrolling
@description

<div class="alert alert-info" role="alert"><strong>Note</strong> It is highly recommended that you turn this feature on alongside pinning, especially
if you plan on using ui-grid on devices.</div>

The custom scrolling feature takes over the default scrolling logic in order to ensure that grid scrolling works without a lag on devices.
To enable, you must include the 'ui.grid.customScrolling' module and you must include the ui-grid-custom-scrolling directive on your grid element.

Documentation for the custom scrolling feature is provided in the api documentation, in particular:

- {@link api/ui.grid.customScrolling.constant:uiGridScrollerConstants uiGridScrollerConstants}
- {@link api/ui.grid.customScrolling.service:uiGridScroller uiGridScroller}
- {@link api/ui.grid.customScrolling.directive:uiGridCustomScrolling uiGridCustomScrolling}

@example
<example module="app">
<file name="app.js">
var app = angular.module('app', ['ngTouch', 'ui.grid', 'ui.grid.pinning', 'ui.grid.customScrolling']);

app.controller('MainCtrl', ['$scope', '$http', '$log', function ($scope, $http, $log) {
$scope.gridOptions = {};

$scope.gridOptions.columnDefs = [
{ name:'id', width:50, enablePinning:false },
{ name:'name', width:100, pinnedLeft:true },
{ name:'age', width:100, pinnedRight:true },
{ name:'address.street', width:150 },
{ name:'address.city', width:150 },
{ name:'address.state', width:50 },
{ name:'address.zip', width:50 },
{ name:'company', width:100 },
{ name:'email', width:100 },
{ name:'phone', width:200 },
{ name:'about', width:300 },
{ name:'friends[0].name', displayName:'1st friend', width:150 },
{ name:'friends[1].name', displayName:'2nd friend', width:150 },
{ name:'friends[2].name', displayName:'3rd friend', width:150 },
];

$http.get('/data/500_complex.json')
.success(function(data) {
$scope.gridOptions.data = data;
});
}]);
</file>
<file name="index.html">
<div ng-controller="MainCtrl">
<div ui-grid="gridOptions" class="grid" ui-grid-pinning ui-grid-custom-scrolling></div>
</div>
</file>
<file name="main.css">
.grid {
width: 100%;
height: 400px;
}
</file>
</example>
Loading