From afa52c68949e23c24c32d39a277f0f2b0f282c1f Mon Sep 17 00:00:00 2001 From: Mark Schouten Date: Mon, 6 Oct 2014 22:37:00 +0200 Subject: [PATCH] Add a timestamp to the user listoptions url which is reset upon adding a user. This refreshes jtables cache --- index.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index db142e1..53370a9 100644 --- a/index.php +++ b/index.php @@ -177,7 +177,13 @@ function displayContent(fieldName) { } } +function getEpoch() { + return Math.round(+new Date()/1000); +} + $(document).ready(function () { + var $epoch = getEpoch(); + $('#SlaveZones').jtable({ title: 'Slave Zones', paging: true, @@ -223,7 +229,7 @@ $(document).ready(function () { width: '8%', display: displayContent('owner'), options: function(data) { - return 'users.php?action=listoptions'; + return 'users.php?action=listoptions&e='+$epoch; }, defaultValue: 'admin', inputClass: 'owner', @@ -380,7 +386,7 @@ $(document).ready(function () { width: '8%', display: displayContent('owner'), options: function(data) { - return 'users.php?action=listoptions'; + return 'users.php?action=listoptions&e='+$epoch; }, defaultValue: 'admin', inputClass: 'owner', @@ -570,7 +576,7 @@ $(document).ready(function () { owner: { title: 'Owner', options: function(data) { - return 'users.php?action=listoptions'; + return 'users.php?action=listoptions&e='+$epoch; }, defaultValue: 'admin', inputClass: 'owner' @@ -682,6 +688,7 @@ $(document).ready(function () { } }, recordAdded: function() { + $epoch = getEpoch(); $("#MasterZones").jtable('reload'); $("#SlaveZones").jtable('reload'); } @@ -693,4 +700,4 @@ $(document).ready(function () { }); - \ No newline at end of file +