Add buttons to remove installed items from a stock item

This commit is contained in:
Oliver Walters 2020-09-28 20:27:13 +10:00
parent b58f7d7461
commit 2ef8464a83

View File

@ -113,8 +113,28 @@ $('#installed-table').inventreeTable({
field: 'actions',
switchable: false,
title: '',
formatter: function(value, row) {
var pk = row.pk;
var html = `<div class='btn-group float-right' role='group'>`;
html += makeIconButton('fa-trash-alt icon-red', 'button-uninstall', pk, '{% trans "Uninstall item" %}');
html += `</div>`;
return html;
}
}
]
],
onLoadSuccess: function() {
var table = $('#installed-table');
// Find buttons and associate actions
table.find('.button-uninstall').click(function() {
var pk = $(this).attr('pk');
});
}
});
{% endblock %}