Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AJAX Communication in Sencha Touch & ExtJS

AJAX Communication in Sencha Touch & ExtJS

Arthur Kay

June 05, 2012
Tweet

More Decks by Arthur Kay

Other Decks in Technology

Transcript

  1. Who am I? ž  Arthur Kay —  Solutions Engineer at

    Sencha, Inc. —  Longtime ExtJS fanatic —  Web developer for 10+ years —  www.akawebdesign.com —  @arthurakay
  2. Sencha Chicago User Group ž  Looking for: —  Speakers — 

    Ideas —  Giveaways —  Sponsors ž  GET INVOLVED!
  3. Agenda ž  What does AJAX really mean? ž  Types: — 

    Stand-alone AJAX requests —  Data Stores —  Form Submissions —  JSONP —  Ext.Direct ž  Example: Creating/Aborting a request ž  Questions
  4. What the #$%& is AJAX? ž  A_synchronous ž  J_avaScript ž 

    A_nd ž  X_ML ž  Circa 1999… now AJASS? (Asynchronous JS and Some Stuff) ž  Really means any asynchronous communication between client/server
  5. Stand-alone AJAX Requests ž  Ext.Ajax() —  ExtJS 3 & 4,

    Sencha Touch ž  Instance of Ext.data.Connection() —  Inherits from Ext.util.Observable() —  ExtJS3 uses Ext.lib.Ajax() (ext-base.js) ž  request() and abort()
  6. Data Stores (ExtJS 3 and Touch) ž  Data stores use

    a DataProxy() —  HttpProxy() defaults to Ext.Ajax(), but can be configured with new Ext.data.Connection() —  ScriptTagProxy() – for use with JSONP ž  Accept a variety of data formats: —  XML —  JSON —  JSONP ž  Great for RESTful APIs
  7. Form Submissions ž  FormPanel() creates an instance of Ext.form.BasicForm() ž 

    Ext.form.Action.Load() and Ext.form.Action.Submit() use Ext.Ajax() internally ž  “standardSubmit” config will not use internal AJAX communication! —  Callbacks and debugging are tricky