Advertisement
LoonerSF

query function asynchronous

Aug 14th, 2012
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Cloud.Objects.query({
  2.         classname:'Reservacion'
  3.     }, function(e){
  4.         if(e.success){
  5.             Titanium.API.info('Success: Count: ' + e.Reservacion.length);
  6.             for(var i=0; i< e.Reservacion.length; i++){
  7.                 data.push({title : e.Reservacion[i].nombre});
  8.             }
  9.             data.sort(sortByTitle);
  10.             tableView.data=data;
  11.         } else {
  12.             alert('Error \n ' + ((e.error && e.message) || JSON.stringify(e)));
  13.         }
  14.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement