mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-05-07 22:42:21 +03:00
Add a timestamp to the user listoptions url which is reset upon adding a user. This refreshes jtables cache
This commit is contained in:
parent
6aab07d79e
commit
afa52c6894
1 changed files with 11 additions and 4 deletions
13
index.php
13
index.php
|
@ -177,7 +177,13 @@ function displayContent(fieldName) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getEpoch() {
|
||||||
|
return Math.round(+new Date()/1000);
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
var $epoch = getEpoch();
|
||||||
|
|
||||||
$('#SlaveZones').jtable({
|
$('#SlaveZones').jtable({
|
||||||
title: 'Slave Zones',
|
title: 'Slave Zones',
|
||||||
paging: true,
|
paging: true,
|
||||||
|
@ -223,7 +229,7 @@ $(document).ready(function () {
|
||||||
width: '8%',
|
width: '8%',
|
||||||
display: displayContent('owner'),
|
display: displayContent('owner'),
|
||||||
options: function(data) {
|
options: function(data) {
|
||||||
return 'users.php?action=listoptions';
|
return 'users.php?action=listoptions&e='+$epoch;
|
||||||
},
|
},
|
||||||
defaultValue: 'admin',
|
defaultValue: 'admin',
|
||||||
inputClass: 'owner',
|
inputClass: 'owner',
|
||||||
|
@ -380,7 +386,7 @@ $(document).ready(function () {
|
||||||
width: '8%',
|
width: '8%',
|
||||||
display: displayContent('owner'),
|
display: displayContent('owner'),
|
||||||
options: function(data) {
|
options: function(data) {
|
||||||
return 'users.php?action=listoptions';
|
return 'users.php?action=listoptions&e='+$epoch;
|
||||||
},
|
},
|
||||||
defaultValue: 'admin',
|
defaultValue: 'admin',
|
||||||
inputClass: 'owner',
|
inputClass: 'owner',
|
||||||
|
@ -570,7 +576,7 @@ $(document).ready(function () {
|
||||||
owner: {
|
owner: {
|
||||||
title: 'Owner',
|
title: 'Owner',
|
||||||
options: function(data) {
|
options: function(data) {
|
||||||
return 'users.php?action=listoptions';
|
return 'users.php?action=listoptions&e='+$epoch;
|
||||||
},
|
},
|
||||||
defaultValue: 'admin',
|
defaultValue: 'admin',
|
||||||
inputClass: 'owner'
|
inputClass: 'owner'
|
||||||
|
@ -682,6 +688,7 @@ $(document).ready(function () {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
recordAdded: function() {
|
recordAdded: function() {
|
||||||
|
$epoch = getEpoch();
|
||||||
$("#MasterZones").jtable('reload');
|
$("#MasterZones").jtable('reload');
|
||||||
$("#SlaveZones").jtable('reload');
|
$("#SlaveZones").jtable('reload');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue