
static.js.users.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of formkiq-server Show documentation
Show all versions of formkiq-server Show documentation
Server-side integration for the FormKiQ ios application
function updateUserListTable(token) {
$.getJSON("/api/users/list?token=" + token, function() {
})
.done(function(data) {
$("#userlisttable > tbody").html("");
$("#userlisttable").append(
$.map(data.users, function (item, index) {
var lastlogin = item.lastlogin;
if (typeof lastlogin === "undefined") {
lastlogin = "never logged in";
}
return ''
+ '' + item.email + ' '
+ '' + item.role + ' '
+ '' + item.status + ' '
+ '' + lastlogin + ' '
+ ''
+ ''
+ ' ';
}).join());
if (data.prevtoken === undefined) {
$('#prev-button').hide();
} else {
$('#prev-button').show();
$('#prev-button').data('token', data.prevtoken);
}
if (data.nexttoken === undefined) {
$('#next-button').hide();
} else {
$("#next-button").data("token", data.nexttoken );
$('#next-button').show();
}
})
.fail(function(data) {
var text = JSON.parse(data.responseText)
showerror("#usereditdiv", "Unable to Get User List - " + text.data);
});
}
$(document).ready(function() {
updateUserListTable("");
$("#next-button").click(function() {
var token = $("#next-button").data("token");
updateUserListTable(token);
});
$("#prev-button").click(function() {
var token = $("#prev-button").data("token");
updateUserListTable(token);
});
});
© 2015 - 2025 Weber Informatics LLC | Privacy Policy