Using the store AJAX approach to get data
Ext.onready (function() { varstore =NewExt.data.JsonStore ({//Store ConfigsStoreId: ' Mystore ', AutoLoad:true, Proxy: {type:' Ajax ', URL:' Getimage.php ', Reader: {type:' JSON ', Root:' Images ', Idproperty:' Name ', //GetData function is first triggered //The GetData here is the equivalent of taking the data away. //The subsequent on event function cannot fetch data through records or through Store.getproxy (). Getreader (). RawData Go to Data //Afterrequest doesn't get the data at all . //getdata:function (data) { //Console.log (' GetData in Reader '); //console.log (data); // }}, Afterrequest:function(req, res) {Console.log ("After Request!", Req.operation.response); } }, //Alternatively, a Ext.data.Model name can be given (see Ext.data.Store for a example)Fields: [' name ', ' URL ', {name:' Size ', type:' Float '}, {name:' Lastmod ', type:' Date ' }] }); Store.load (); //is called multiple times :Store.on ({' Load ':function(store, records, success, opts) {Console.log (' On1 '); Console.log (Success); //Records is []Console.log (Records); //PS RawData is a {}Console.log (Store.getproxy (). Getreader (). RawData); } }, This, {single:true}); Store.on (' Load ',function(store, records, success, eopts) {Console.log (' On2 '); Console.log (Success); Console.log (Records); Console.log (Store.getproxy (). Getreader (). RawData); }); Store.load ({callback:function(Records, opts, success) {Console.log (' Load '); Console.log (Success); Console.log (Records); } }); //Console.log (store);});
Ext Store Proxy Ajax