mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
Add missing callback for attachment delete button (#5219)
This commit is contained in:
parent
a9a8ac1c70
commit
b3dcc28bd9
@ -281,10 +281,20 @@ function loadAttachmentTable(url, options) {
|
|||||||
sidePagination: 'server',
|
sidePagination: 'server',
|
||||||
onPostBody: function() {
|
onPostBody: function() {
|
||||||
|
|
||||||
|
// Add callback for 'delete' button
|
||||||
|
if (permissions.delete) {
|
||||||
|
$(table).find('.button-attachment-delete').click(function() {
|
||||||
|
let pk = $(this).attr('pk');
|
||||||
|
let attachments = $(table).bootstrapTable('getRowByUniqueId', pk);
|
||||||
|
|
||||||
|
deleteAttachments([attachments], url, options);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Add callback for 'edit' button
|
// Add callback for 'edit' button
|
||||||
if (permissions.change) {
|
if (permissions.change) {
|
||||||
$(table).find('.button-attachment-edit').click(function() {
|
$(table).find('.button-attachment-edit').click(function() {
|
||||||
var pk = $(this).attr('pk');
|
let pk = $(this).attr('pk');
|
||||||
|
|
||||||
constructForm(`${url}${pk}/`, {
|
constructForm(`${url}${pk}/`, {
|
||||||
fields: {
|
fields: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user