Load json with ExtJs.Ajax and Ext.util.JSON
September 23rd, 2009
An example how to use the ExtJs classes Ext.Ajax and Ext.util.JSON to load json encoded data into a javascript object from a remote source.
// we do this (in this example) when Ext is ready Ext.onReady(function(){ // do the Ext.Ajax.request Ext.Ajax.request({ // the url to the remote source url: 'data/persons.json', // define a handler for request success success: function(response, options){ var persons = Ext.util.JSON.decode(response.responseText); // use the persons object... // u can uncomment the following line if firebug is available // console.info(persons); } // NO errors ! ;) // failure: personsRequest_onFailure ... or something else }); }); |
Dezember 9th, 2015 at 21:07
in Book Reviews, ExtJS ***(This book has been replaced by a new one from the same aorhuts titled Learning Ext JS 3.2 and you should order that one and not this one) I’ve been learning ExtJS now for a couple