diff --git a/InvenTree/stock/templates/stock/item_installed.html b/InvenTree/stock/templates/stock/item_installed.html index c9c429c87b..72451f11e9 100644 --- a/InvenTree/stock/templates/stock/item_installed.html +++ b/InvenTree/stock/templates/stock/item_installed.html @@ -113,8 +113,28 @@ $('#installed-table').inventreeTable({ field: 'actions', switchable: false, title: '', + formatter: function(value, row) { + var pk = row.pk; + + var html = `
`; + + html += makeIconButton('fa-trash-alt icon-red', 'button-uninstall', pk, '{% trans "Uninstall item" %}'); + + html += `
`; + + 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 %} \ No newline at end of file