Newer
Older
var attributes_table = $("#attributes_table").DataTable({
var kind = $("li a.nav-link.active").text();
$SCRIPT_ROOT + "/inventory/_retrieve_attributes/" + kind,
targets: [0],
orderable: false,
className: "text-center align-middle",
// render a checkbox to add/remove the attribute to the user's favorites
var checked = data.favorite ? "checked" : "";
return (
'<input type="checkbox" value="' + data.id + '" ' + checked + ">"
);
return (
'<img class="img-fluid" src="data:image/png;base64,' + data + '">'
);
$("#attributes_table").on("change", 'input[type="checkbox"]', function () {
var kind = $("li a.nav-link.active").text();
url: $SCRIPT_ROOT + "/inventory/_update_favorites/" + kind,
data: JSON.stringify({
id: $(this).val(),
var attributes_favorites_table = $("#attributes_favorites_table").DataTable({
$.getJSON(
$SCRIPT_ROOT + "/inventory/_retrieve_attributes_favorites",
// render QR code from base64 string
return (
'<img class="img-fluid" src="data:image/png;base64,' + data + '">'
);