Slide 1

Slide 1 text

Presented by Art Kay

Slide 2

Slide 2 text

Who am I? ž  Arthur Kay —  Solutions Engineer at Sencha, Inc. —  Longtime ExtJS fanatic —  Web developer for 10+ years —  www.akawebdesign.com —  @arthurakay

Slide 3

Slide 3 text

Sencha Chicago User Group ž  Looking for: —  Speakers —  Ideas —  Giveaways —  Sponsors ž  GET INVOLVED!

Slide 4

Slide 4 text

Agenda ž  What does AJAX really mean? ž  Types: —  Stand-alone AJAX requests —  Data Stores —  Form Submissions —  JSONP —  Ext.Direct ž  Example: Creating/Aborting a request ž  Questions

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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()

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

Data Stores (ExtJS 4) ž  Ext.data.proxy.Server() —  Sub-classes include Rest(), Ajax(), JsonP() —  Define appropriate reader

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

JSONP ž  Use Ext.data.ScriptTagProxy() —  Ext.data.proxy.JsonP() and Ext.data.JsonP in ExtJS 4 ž  Allows cross-domain scripting

Slide 11

Slide 11 text

Ext.Direct

Slide 12

Slide 12 text

Example ž  Creating and Aborting a request using Ext.Ajax()

Slide 13

Slide 13 text

Questions