Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ng-grid paging
Message
From
24/10/2014 02:27:39
 
General information
Forum:
Javascript
Category:
Other
Title:
Miscellaneous
Thread ID:
01609778
Message ID:
01609846
Views:
33
>Here is another problem which may be related. My code in the Load method:
>
>
> var loadAccount = function (id, isNew) {
>              $scope.alertType = '';
>              $scope.loadingTimeout = $timeout(function () {
>                  $scope.isEditLoading = true;
>              }, 250);
>              accountsService.getAccount(id, isNew, $scope.showFinalized).then(function (data) {
>                  $scope.currentAccount = data;
>                  $scope.currentAccount.totalBalance = 0;
>                  $scope.gridData = $scope.currentAccount.invoices;
>                  $scope.currentAccount.fullPhone = $filter('phone')($.trim(data.areaCode) + '' + $.trim(data.phone));
>                  var systemAccounts = ["*GUESTS*", "*RESRVATN*", "*TABLES*", "*DEBIT*"];
>
>                  $scope.currentAccount.isSystemAccount = false;
>                  $scope.isNew = isNew;
>                  if (!isNew) {
>                      $scope.currentAccount.isSystemAccount = systemAccounts.indexOf($scope.currentAccount.acctName.trim()) >= 0;
>                      $scope.getPagedDataAsync($scope.pagingOptions.pageSize, 1);
>                      accountsService.getAccountBalance($scope.currentAccount.acctNameHash).then(function (data) {
>                          $scope.currentAccount.totalBalance = data.balance;
>                      });
>                  }
>                  $scope.showForm = true;
>                  $scope.alertType = '';
>                  $scope.isEditLoading = false;
>                  $timeout.cancel($scope.loadingTimeout);
>                  $timeout(function () {
>                      $rootScope.$broadcast('sm:resizeContainer');
>                      $rootScope.$broadcast('sm:focus');
>                  }, 0);
>              });
>          };
>
>
>When I set break point at the very top line of code, it breaks. However, all break points inside the
>
>accountsService.getAccount(id, isNew, $scope.showFinalized).then(function (data) {
>...
>
>
>
>are not executed. However, I can clearly see that the code does execute as the balance and system account are shown correctly.


>
>So, do you see what may be the problem and why I can not get inside that method? I think in other cases when I tried to debug other forms I have seen that code executing.
>
>UPDATE. As soon as I commented out this line
>
>// $scope.getPagedDataAsync($scope.pagingOptions.pageSize, 1);
>
>in the inner portion of the code, the break points started to work.

That seems to imply an exception being thrown somewhere in $scope.getPagedDataAsync()? Do you have 'Pause on exceptions' checked in the debugger ?
IIRC correctly this method is no longer actually async - is that correct ?

Also, can you explain how your logic regarding ' $scope.isEditLoading ' - why are you waiting 250ms before setting it true ?


>
>The other problem is when there are 0 items initially, the paging options appear outside of the grid (beneath it) which I don't like.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform