-
Notifications
You must be signed in to change notification settings - Fork 489
row click events? #14
Comments
You can add the option $scope.dtOptions = DTOptionsBuilder.fromSource('data.json')
.withOption('fnRowCallback', function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
// Do your things
return nRow;
}); You can find an example here (click on firstName column and item on angular scope is updated). |
Thanks for the helpful example. It leads to another issue, though. Does running ajax calls via DataTables 1.10 has an option for passing data called: 'data'. It seems like supplying data via that method would be more |
No, it's indeed not the "Angular way" to fetch the data. However, your comment makes me realize that I can use promises instead of an ajax call, something that will look like this: $scope.dtOptions = DTOptionsBuilder.fromPromise(myFactory.getFoo()); and angular.module('myModule').factory('myFactory', function($resource) {
return {
getFoo: function() {
return $resource('foo.json').get().$promise;
}
};
}); |
Here an example using |
Definitely an interesting project.
Do you have any examples demonstrating row-click events as this prior attempt
at combining angular and datatables shows?
https://groups.google.com/forum/#!topic/angular/vM2DEMK_NMA
(click on "price" column, and item on angular scope is updated)
http://jsfiddle.net/zdam/7kLFU/
The text was updated successfully, but these errors were encountered: