Use Ajax in ext

Source: Internet
Author: User

In general, in the tree of Ext, table directly inherits the Ajax Asynchronous Method to retrieve data. However, sometimes Ajax is used independently.

How to Use Ajax separately in Ext? The basic usage is as follows:

 Ext.Ajax.request({   url: "url",   method: 'POST',   params: {classID: 'value'},   success:function(response,result)   {       var data = Ext.util.JSON.decode(response.responseText);                       },   failure:function()   {          } });

If you want to pass all input in the form as a parameter, how can you use it? (By input name/value)

1. First find the input in all forms

Ext. Query ("input", from );

2. Use Ext. Data. Record to obtain the data. (I have thought about directly grouping Params strings, but I cannot. I cannot read them)

VaR rs = new Ext. Data. Record ({'id': Sid });
Rs. Set (sname, svalue );

3. Finally, pass Rs. Data to Params.

Params: Rs. Data

The above is a situation where there are many parameters in form and high security considerations.

If the image is simply connected to the end of the URL through the get method

Related Article

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.