How to post json data with extJS

maximus picture maximus · May 27, 2010 · Viewed 50.4k times · Source

I'm a bit of a newb with both extJS and json. What is the most painless route to POSTing json data using extJS? I'm not really interested any GUI features, just using the framework to send some sample data.

Answer

Krishna K picture Krishna K · May 27, 2010
Ext.Ajax.request({
   url: 'foo.php',    // where you wanna post
   success: passFn,   // function called on success
   failure: failFn,
   params: { foo: 'bar' }  // your json data
});