Summary of EXTJS4 problems

Source: Internet
Author: User

1, Ext AJAX Store and from timeout solution

when using the ext grid, if the background calculation is large or the amount of data returned is too large to cause the load data time-out, time-out will find that the grid has no data display. The workaround is to set the time-out to a large point, and the AJAX default request for Ext is 30 seconds. The Setup method is as follows:Ext.Ajax.timeout = 90000; one second =1000 milliseconds. The above setting is to set timeout to 90 seconds.

The From object of Ext also has a time-out problem when loading data asynchronously. The workaround is as follows:ext.data.connection.prototype.timeout= ' 9000 '; sets the Ajax request time by default of 30 seconds.

2. ExtJs4 fields and root names are case-sensitive when reading XML files

Ext.define (' MyData ', {
Extend: ' Ext.data.Model ',
Fields: [{name: ' job_id ', Mapping: ' job_id '}
, ' Job_desc '
, ' MIN_LVL '
, ' MAX_LVL '
]
});

var store = ext.create (' Ext.data.Store ', {
StoreId: ' DataStore ',
Autoload:true,
Model: ' MyData ',
Proxy: {
Type: ' Ajax ',
URL: ' Myxmldata.xml ',//' getextjsdata.aspx?parm=list ',
Reader: {
Type: ' xml ',
Root: ' DataSet ',
Record: ' Record '
}
}
});

XML file format: Add root directory ' DataSet ' to multiple records

<?xml version= ' 1.0 ' encoding= ' utf-8 ',
<dataset>
     <record>
            <job_id>1</job_id>
             <job_desc>name1</job_desc>
             <min_lvl>23</min_lvl>
             <max_lvl>33</max_lvl>
    </record>
  <record>
    <job_id>2</job_id>
     <job_desc>name1</job_desc>
    <min_lvl>23</min_lvl>
     <max_lvl>33</max_lvl>
  </record>
</dataset>

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.