Guest User

Untitled

a guest
Jul 27th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. how to read the response json data from the server in sencha touch
  2. url: 'serverurl',
  3.  
  4. headers: { 'Content-Type': 'application/json;charset=utf-8' },
  5.  
  6. params: {
  7.  
  8. username: 'username',
  9.  
  10. password: 'password'
  11. },
  12.  
  13. method: 'GET',
  14.  
  15. success: handleSuccess,
  16.  
  17. failure: handleError
  18.  
  19. });
  20.  
  21. Ext.Ajax.request({
  22. url: URL,
  23. defaultHeaders : 'application/json',
  24.  
  25. success : function(response, opt) {
  26. // this will give you the JSON
  27. Ext.Msg.alert('Success', response.responseText);
  28. },
  29.  
  30. failure : function(response, opt) {
  31. Ext.Msg.alert('Failed', response.responseText);
  32. }
  33. });
Add Comment
Please, Sign In to add comment