Ext Store Proxy Ajax

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.