Error cache flexigrid iOS6 - no refresh data [SOLVED]

Publicado el 07-11-2012

With iOS6 update many WebAPPs using flexigrid have a big trouble. Safari use cache in POST queries. That means if you change some data shown in a flexigrid, it not be updated in a refresh, you should refresh twice!

 

That was a big problem form my applications, and I have been looking some way to fix it.

 

When I have readen thesee posts:

http://arstechnica.com/apple/2012/09/developers-claim-safari-in-ios-6-breaks-web-apps-with-aggressive-caching/

http://stackoverflow.com/questions/12506897/is-safari-on-ios-6-caching-ajax-results

I realized what was happening and I could reach the solution: just edit flexigrid.js and add a cache param in the ajax call:

Edit:

$.ajax({
   type: p.method,
   url: p.url,
   data: param,
   dataType: p.dataType,
  // success: ,
   success: function(data){g.addData(data);},
   error: function(data) { try { if (p.onError) p.onError(data); } catch (e) {} }
 });

adding:

$.ajax({
   type: p.method,
   url: p.url,
   data: param,
   cache: false,
   dataType: p.dataType,
  // success: ,
   success: function(data){g.addData(data);},
   error: function(data) { try { if (p.onError) p.onError(data); } catch (e) {} }
 });

UPDATE:

If it doesn't work tray adding a new an variable on time param to the ajax call:

auxD = new Date();
var param = [
  { name : 'page', value : p.newp }
  ,{ name : 'rp', value : p.rp }
  ,{ name : 'sortname', value : p.sortname}
  ,{ name : 'sortorder', value : p.sortorder }
  ,{ name : 'query', value : p.query}
  ,{ name : 'qtype', value : p.qtype}
  ,{ name : 'nocache', value: auxD.getHours()*10000+auxD.getMinutes()*100+auxD.getSeconds()}
];

 

 

UPDATE 2:

http://proogresa.es/blog/52-algoritmos/203-ios6-safari-error-with-cache-problem-fixed.html

Categorías: Algoritmos

Comparte este artículo

https://proogresa.es/blog/52-algoritmos/202-error-cache-flexigrid-ios6-no-refresh-data
contacto

Web Project & Online Marketing Proogresa S.L. © 2024 | Condiciones Legales | Política de Privacidad | Política de Cookies | Mapa del Sitio HTML , XML | Compliance


Clica AQUÍ para más información. Puedes aceptar todas las cookies pulsando el botón "ACEPTAR" o rechazar todas las cookies pulsando en el botón "RECHAZAR". También puedes configurar su uso clicando AQUÍ.