Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Commit f6cd4fa

Browse files
committed
Update doc #76
1 parent b218e98 commit f6cd4fa

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

demo/bindAngularDirective.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@
1919
$scope.dtOptions.reloadData();
2020
};
2121

22-
$scope.dtOptions = DTOptionsBuilder.fromSource('data.json')
22+
$scope.dtOptions = DTOptionsBuilder.fromSource('data1.json')
2323
.withPaginationType('full_numbers')
24-
.withOption('initComplete', function(settings) {
24+
.withOption('createdRow', function(row, data, dataIndex) {
2525
// Recompiling so we can bind Angular directive to the DT
26-
$compile(angular.element('#' + settings.sTableId).contents())($scope);
26+
$compile(angular.element(row).contents())($scope);
2727
});
2828
$scope.dtColumns = [
2929
DTColumnBuilder.newColumn('id').withTitle('ID'),
3030
DTColumnBuilder.newColumn('firstName').withTitle('First name'),
31-
DTColumnBuilder.newColumn('lastName').withTitle('Last name').notVisible(),
31+
DTColumnBuilder.newColumn('lastName').withTitle('Last name'),
3232
DTColumnBuilder.newColumn(null).withTitle('Actions').notSortable()
3333
.renderWith(function(data, type, full, meta) {
3434
return '<button class="btn btn-warning" ng-click="edit(' + data.id + ')">' +

demo/partials/bind_angular_directive.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ <h1><i class="fa fa-play"></i>&nbsp;Binding Angular directive to the DataTable</
4545
$scope.dtOptions.reloadData();
4646
};
4747

48-
$scope.dtOptions = DTOptionsBuilder.fromSource('data.json')
48+
$scope.dtOptions = DTOptionsBuilder.fromSource('data1.json')
4949
.withPaginationType('full_numbers')
50-
.withOption('initComplete', function(settings) {
50+
.withOption('createdRow', function(row, data, dataIndex) {
5151
// Recompiling so we can bind Angular directive to the DT
52-
$compile(angular.element('#' + settings.sTableId).contents())($scope);
52+
$compile(angular.element(row).contents())($scope);
5353
});
5454
$scope.dtColumns = [
5555
DTColumnBuilder.newColumn('id').withTitle('ID'),
5656
DTColumnBuilder.newColumn('firstName').withTitle('First name'),
57-
DTColumnBuilder.newColumn('lastName').withTitle('Last name').notVisible(),
57+
DTColumnBuilder.newColumn('lastName').withTitle('Last name'),
5858
DTColumnBuilder.newColumn(null).withTitle('Actions').notSortable()
5959
.renderWith(function(data, type, full, meta) {
6060
return '<button class="btn btn-warning" ng-click="edit(' + data.id + ')">' +

0 commit comments

Comments
 (0)