Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ng-grid paging
Message
De
27/10/2014 08:21:01
 
 
Information générale
Forum:
Javascript
Catégorie:
Autre
Titre:
Divers
Thread ID:
01609778
Message ID:
01609966
Vues:
35
>>>>Trying things at random means you are just thrashing around. If something doesn't work then debug 'till you find out why - then look for the solution.
>>>
>>>Ok, looks like I got the answer on stackoverflow:
>>>
>>>http://stackoverflow.com/questions/26536362/angularjs-ng-grid-shows-blank-grid-first
>>>
>>>It does indeed sound like the resizing problem as switching between dev. tools and back causes resize and also 2 accounts correctly show up right away (but not others).
>>>
>>>Adding $(window).trigger('resize'); at the end of the load procedure fixed the problem for me. Now when this guy explained that problem, it seems quite obvious that it was indeed the problem with resizing.
>>
>>>UPDATE. I re-introduced the paging back, all as well now.
>>>
>>>Well, thanks to that guy in stackoverflow for the answer!
>>
>>It's certainly not 'a problem with resizing' - resizing is a hack that probably works because it runs a digest. I'd bet the real problem is that your code is not triggering the digest.. In fact, looking closely, your implementation of 'setPagingData() differs from the plunkr :
if (!$scope.$$phase) {
>>            $scope.$apply();
>>        }
>
>I believe my code was exactly the same as plunker's code. Also, I was trying to add $scope.$apply() and the end of the load procedure in addition to that code and it had no effect.

Another question: in setPagingData() you have
$scope.totalServerItems = data.length;
Is the totalServerItems the value you were referring to when you said the total number of items shows correctly ?
If so you're not comparing like with like - data is not your grid source.....
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform