制表符 - 如何从 json 文件刷新 table
Tabulator - How to refresh table from json file
我正在尝试从 JSON 文件更新我的 Tabulator table。当一个项目被提交或删除时,它会触发一个 PHP 文件来更新文件。但是,table 不会更新。如果我硬重新加载页面 (CTRL+F5),table 会正确更新。否则,它不会通过定期重新加载进行更新。我的代码中有一个 location.refresh();
,用于删除 ajax 对我的 PHP 文件的成功请求。我的 PHP 个文件有一个 "Refresh:0; url = tabulator.html"
。我已经尝试添加到我的 html 页面的顶部:
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
以及我的 PHP 文件的顶部:
header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1.
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache'); // HTTP 1.0.
header('Expires: 0');
在我的 table 创建结束时,我有 table.setData();
,因为我使用 ajaxURL 将数据加载到 table。任何人都知道如何在提交或删除项目时使用 JSON 文件中的数据刷新 table?提前致谢。
使用reactiveData:true, //enable reactive data
检查c documentation
我正在尝试从 JSON 文件更新我的 Tabulator table。当一个项目被提交或删除时,它会触发一个 PHP 文件来更新文件。但是,table 不会更新。如果我硬重新加载页面 (CTRL+F5),table 会正确更新。否则,它不会通过定期重新加载进行更新。我的代码中有一个 location.refresh();
,用于删除 ajax 对我的 PHP 文件的成功请求。我的 PHP 个文件有一个 "Refresh:0; url = tabulator.html"
。我已经尝试添加到我的 html 页面的顶部:
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
以及我的 PHP 文件的顶部:
header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1.
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache'); // HTTP 1.0.
header('Expires: 0');
在我的 table 创建结束时,我有 table.setData();
,因为我使用 ajaxURL 将数据加载到 table。任何人都知道如何在提交或删除项目时使用 JSON 文件中的数据刷新 table?提前致谢。
使用reactiveData:true, //enable reactive data
检查c documentation