只在ipad上用AJAX在制表机上加载数据时出错



我有一个安装了symfony 3.4的php服务器,我制作了一个应用程序,人们可以在其中连接并发送订单。所有功能在PC和所有其他移动设备(如iphone(上都很好,但在ipad上不起作用。我真的不知道为什么。我在网上发现ipad在缓存和AJAX调用方面有问题,但我不知道如何在制表机配置上停用缓存。

这就是制表器初始化(我删除了列和回调的列表,因为它很长,它们可以与所有其他系统一起使用,所以我认为这不是问题所在(:

table = new Tabulator("#tabellaOrdinazione", {
height: ($(window).height() - $("#inizioContenuti").position().top) + "px",
ajaxURL: Routing.generate('agente_ordine_nuovo_lista_ajax', {
codiceCliente:  $("#codiceClienteTxt").val()
}),
ajaxProgressiveLoad:"scroll",
ajaxProgressiveLoadScrollMargin:300,
ajaxFiltering:true,
ajaxSorting:true,
layout:"fitDataFill",
placeholder: "No data!",
columns:[

编辑:我刚刚尝试过更改缓存,没有像附加代码那样的缓存,但结果是一样的。在除iPad 之外的所有设备上工作

table = new Tabulator("#tabellaOrdinazione", {
height: ($(window).height() - $("#inizioContenuti").position().top) + "px",
ajaxURL: Routing.generate('agente_ordine_nuovo_lista_ajax', {
codiceCliente:  $("#codiceClienteTxt").val()
}),
ajaxProgressiveLoad:"scroll",
ajaxProgressiveLoadScrollMargin:300,
ajaxFiltering:true,
ajaxSorting:true,
ajaxConfig: {
cache: 'no-cache',
credentials: 'same-origin'
},
layout:"fitDataFill",
placeholder: "No data!",
columns:[

我已经解决了JQUERY Ajax的问题。我已经覆盖了Tabulator的Request承诺,并添加了一个JQUERY ajax来从我的服务器加载数据,现在ipad也可以工作了。

这是代码:

function ottieniDatiRicerca(url, config, params){
//url - the url of the request
//config - the ajaxConfig object
//params - the ajaxParams object
//return promise
return new Promise(function(resolve, reject){
$.ajax({
type: "GET",
dataType: 'html',
url: url + "?params=" + encodeURI(JSON.stringify(params)),
async: true,
success: function (response) {
resolve(JSON.parse(response));
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
reject("Status: " + textStatus);
}
});
});
}
function inizializzaTabulator(){
table = new Tabulator("#tabellaOrdinazione", {
height: ($(window).height() - $("#inizioContenuti").position().top) + "px",
ajaxURL: Routing.generate('agente_ordine_nuovo_lista_ajax', {
codiceCliente:  $("#codiceClienteTxt").val()
}),
ajaxProgressiveLoad:"scroll",
ajaxProgressiveLoadScrollMargin:300,
ajaxFiltering:true,
ajaxSorting:true,
ajaxRequestFunc:ottieniDatiRicerca,
layout:"fitDataFill",
placeholder: "No data!",
columns:[

问题可能是由于iPad、上缺乏获取兼容性

你试过在表格库之前加入Fetch Polyfill吗

最新更新