Advertisement
Guest User

Untitled

a guest
Aug 31st, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. var cars = $('#mypage').data('carsdata');
  2.  
  3. if (cars == null) {
  4. var clientId = $("input[name='ClientId']").val();
  5. worksheet.ajax.execute('GET','/Cars/GetData/', { clientId: clientId }, function (res) {
  6. if (res == "") {
  7. return;
  8. }
  9.  
  10. cars = res.Owners.filter(function (e) {
  11. if (e.Email) {
  12. return true;
  13. }
  14. return false;
  15. }).map(function (e) {
  16. return { key: e.Id, label: e.Email };
  17. });
  18.  
  19. console.log("1" +cars.length); // cars lenght is 3
  20. });
  21.  
  22.  
  23. console.log("2" +cars.length); // cars is null
  24.  
  25. console.log("1" +cars.length);
  26.  
  27. console.log("2" +cars.length);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement