When my controller initializes, I fetch all the necessary data for my table from a rest call. Here is the code snippet:
tableService.getList(function(response) {
$scope.back = response
blockUI.start("Wait...");
$timeout(function() {
$scope.response = $scope.back;
blockUI.stop();
}, 100);
});
This code works perfectly. I had to include a $timeout function because angular-footable doesn't play well with ng-repeat, so a delay was necessary before rendering the data.
The table also includes a feature where users can filter the data displayed. When the user clicks the 'Filter' button, a request is sent to the server, and the table data needs to be updated accordingly. This triggers another request:
tableService.getListWithParameters(params,function(response) {
$scope.back = response
blockUI.start("Wait...");
$timeout(function() {
$scope.response = $scope.back;
blockUI.stop();
}, 100);
});
However, despite receiving different responses, the table does not update. I've attempted to manually redraw the table by calling:
$('.table').trigger('footable_redraw');
Unfortunately, this doesn't seem to work. Can anyone provide guidance on how to ensure that angular-footable updates the table data correctly when dealing with rest calls?