static.js.admin.users.folders.files.js Maven / Gradle / Ivy
function updateFormsTable2(token) {
$("#formlist2").show();
var folder = $("#folder").val();
var form = $("#form").val();
$.getJSON("/api/folders/files/list?folder=" + folder + "&uuid=" + form + "&token=" + token, function(data) {
var list = data.forms;
var count = 0;
$("#formlisttable2 > tbody").html("");
$("#formlisttable2").append(
$.map(list, function (item, index) {
count++;
return ''
+ '' + item.label1 + ' '
+ '' + item.label2 + ' '
+ '' + item.label3 + ' '
+ '' + item.updated_date + ' '
+ ''
+ ''
+ ' ';
}).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();
}
if (count == 0) {
$("#formlisttable2").append("No " + type + "s ");
} else {
$('.longtext').collapser({
mode: 'lines',
truncate: 3,
showText: 'more',
hideText: 'less',
changeText: 1
});
}
});
}
$(document).ready(function() {
updateFormsTable2("");
$("#next-button").click(function() {
var token = $("#next-button").data("token");
updateFormsTable2(token);
});
$("#prev-button").click(function() {
var token = $("#prev-button").data("token");
updateFormsTable2(token);
});
});