Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. for(var i=0; i<=pages;i++) {
  2. top = i * config.ROWS_PER_PAGE;
  3. left = 0;
  4. width = config.DATA_PER_ROW;
  5. height = Math.min(config.ROWS_PER_PAGE, rowCount - i * config.ROWS_PER_PAGE);
  6. var ff = makeCallbackFunc(top, left, width, height);
  7. func.push(ff(function () {return true;}));
  8. }
  9.  
  10. async.map(
  11. func,
  12. function(err, results){
  13. //???? Can not read the results output here!!??
  14. console.log('all calls called without any errors');
  15. });
  16.  
  17. function makeCallbackFunc(top, left, width, height) {
  18. return function (callback) {
  19. console.log('top: ' + top + 'left: ' + left + 'width: ' + width + 'height: ' + height);
  20. return backendApi.getData([{
  21. qTop: top,
  22. qLeft: left,
  23. qWidth: width,
  24. qHeight: height
  25. }]);
  26.  
  27. };
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement