Solution: easyUI1.2.6 + datagrid cannot be reloaded or queried in IE browser

Source: Internet
Author: User
I) easyUI1.2.6datagrid in IE browser currently has problem 1: cannot reload, query varrow $ (# dg_user_table ). datagrid (getSelected); $ (# dg_userPri_table ). datagrid ({method: POST, height: 280, url: remotePathquserrolerow. id ,...

I) easyUI 1.2.6 current problems of datagrid in IE browser 1: Unable to reload and query var row =$ ('# dg_user_table '). datagrid ('getselected'); $ ('# dg_userPri_table '). datagrid ({method: 'post', height: 280, url: remotePathq 'user/role/'row. id ,...

I) easyUI 1.2.6 + current problems of datagrid in IE browser

1: Unable to reload or query

Var row = $ ('# dg_user_table'). datagrid ('getselected ');

$ ('# Dg_userPri_table'). datagrid (
{
Method: 'post ',
Height: 280,
Url: remotePathq + 'user/role/'+ row. id,

......

});

BUG: When IE cache is not cleared or IE is disabled and re-opened, the queried data is the last cached and historical data. Non-real-time data (other firefox, Google Chrome is normal)



Cause: the 'post' request address sent by the datagrid is the same. As a result, the IE browser does not query data again, but directly obtains historical data from the last cache;



2: The reload method is invalid:

That is, $ ('# dg_user_table'). datagrid ('reload'); The datagrid URL request is not triggered and data is not updated;

Cause: the 'post' request address sent by the datagrid is the same. As a result, the IE browser does not query data again, but directly obtains historical data from the last cache (same as above)


II) solution:

Add a random number of unique values to the http restful service address to distinguish the RESTFUL service address loaded each time;

That is:

Var randomNu = (new Date (). getTime () ^ Math. random ();

Url: remotePathq + 'user/role/'+ row. id +"? _ = "+ RandomNu,

Corrected:

Var row = $ ('# dg_user_table'). datagrid ('getselected ');

Var randomNu = (new Date (). getTime () ^ Math. random ();

$ ('# Dg_userPri_table'). datagrid (
{
Method: 'post ',
Height: 280,
Url: remotePathq + 'user/role/'+ row. id +"? _ = "+ RandomNu,

......

});

The reload method is also available;

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.